mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Xingxing Luo <xingxing.luo@unisoc.com>, <b-liu@ti.com>,
	<gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<xingxing0070.luo@gmail.com>, <Zhiyong.Liu@unisoc.com>,
	<Cixi.Geng1@unisoc.com>, <Orson.Zhai@unisoc.com>,
	<zhang.lyra@gmail.com>
Subject: Re: [PATCH] usb: musb: Get the musb_qh poniter after musb_giveback
Date: Thu, 14 Sep 2023 13:15:30 +0300	[thread overview]
Message-ID: <22c3a910-0c16-fe94-06e6-28650cf0e634@omp.ru> (raw)
In-Reply-To: <8365ba2a-8ecd-d055-e962-3a7f2bfdbfb0@omp.ru>

On 9/14/23 1:06 PM, Sergey Shtylyov wrote:
[...]

>> When multiple threads are performing USB transmission, musb->lock will be
>> unlocked when musb_giveback is executed. At this time, qh may be released
>> in the dequeue process in other threads, resulting in a wild pointer, so
>> it needs to be here get qh again, and judge whether qh is NULL, and when
>> dequeue, you need to set qh to NULL.
>>
>> Fixes: dbac5d07d13e ("usb: musb: host: don't start next rx urb if current one failed")
>> Signed-off-by: Xingxing Luo <xingxing.luo@unisoc.com>
>> ---
>>  drivers/usb/musb/musb_host.c | 9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
>> index a02c29216955..9df27db5847a 100644
>> --- a/drivers/usb/musb/musb_host.c
>> +++ b/drivers/usb/musb/musb_host.c
>> @@ -321,10 +321,16 @@ static void musb_advance_schedule(struct musb *musb, struct urb *urb,
>>  	musb_giveback(musb, urb, status);
>>  	qh->is_ready = ready;
>>  
>> +	/*
>> +	 * musb->lock had been unlocked in musb_giveback, so somtimes qh
> 
>    Sometimes?
> 
>> +	 * may freed, need get it again

+	 * may be freed, need to get it again

   Overlooked it in the 1st review, sorry...

[...]

MBR, Sergey

  reply	other threads:[~2023-09-14 10:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14  1:56 Xingxing Luo
2023-09-14 10:06 ` Sergey Shtylyov
2023-09-14 10:15   ` Sergey Shtylyov [this message]
     [not found]   ` <CANnj+8S6AXjkdO3sQnK-H7a-TSOxbqUQi3U5H+q_8wA-JcAV5g@mail.gmail.com>
     [not found]     ` <f3463cff-c6d5-07e7-2f94-cdcbc76d3957@omp.ru>
     [not found]       ` <CANnj+8R8ueWOOE=yA-pug7EEs0DRyh65dyRV8owQae1pZv5b9g@mail.gmail.com>
2023-09-18  5:50         ` xingxing luo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22c3a910-0c16-fe94-06e6-28650cf0e634@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=Cixi.Geng1@unisoc.com \
    --cc=Orson.Zhai@unisoc.com \
    --cc=Zhiyong.Liu@unisoc.com \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=xingxing.luo@unisoc.com \
    --cc=xingxing0070.luo@gmail.com \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®