mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: ep0: Don't reset resource alloc flag (including ep0)
Date: Wed, 14 Aug 2024 23:43:43 +0300	[thread overview]
Message-ID: <e26d660b-ce53-6208-d56b-b33a1d1b22be@omp.ru> (raw)
In-Reply-To: <c0e06e73-f6d1-1943-fc83-2cf742280398@omp.ru>

On 8/14/24 11:42 PM, Sergey Shtylyov wrote:
[...]

>> The DWC3_EP_RESOURCE_ALLOCATED flag ensures that the resource of an
>> endpoint is only assigned once. Unless the endpoint is reset, don't
>> clear this flag. Otherwise we may set endpoint resource again, which
>> prevents the driver from initiate transfer after handling a STALL or
>> endpoint halt to the control endpoint.
>>
>> Commit f2e0eee47038 (usb: dwc3: ep0: Don't reset resource alloc flag)
> 
>    You forgot the double quotes around the summary, the same as you
> do in the Fixes tag.
> 
>> was fixing the initial issue, but did this only for physical ep1. Since
>> the function dwc3_ep0_stall_and_restart is resetting the flags for both
>> physical endpoints, this also has to be done for ep0.
>>
>> Cc: stable@vger.kernel.org
>> Fixes: b311048c174d ("usb: dwc3: gadget: Rewrite endpoint allocation flow")
>> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>> ---
>>  drivers/usb/dwc3/ep0.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
>> index d96ffbe520397..c9533a99e47c8 100644
>> --- a/drivers/usb/dwc3/ep0.c
>> +++ b/drivers/usb/dwc3/ep0.c
>> @@ -232,7 +232,8 @@ void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
>>  	/* stall is always issued on EP0 */
>>  	dep = dwc->eps[0];
>>  	__dwc3_gadget_ep_set_halt(dep, 1, false);
>> -	dep->flags = DWC3_EP_ENABLED;
>> +	dep->flags &= DWC3_EP_RESOURCE_ALLOCATED;
> 
>    No ~ afer &=?

   Sorry, I wasn't attentive enough while reading the patch description... :-/

[...]

MBR, Sergey

  reply	other threads:[~2024-08-14 20:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 17:39 Michael Grzeschik
2024-08-14 20:42 ` Sergey Shtylyov
2024-08-14 20:43   ` Sergey Shtylyov [this message]
2024-08-14 22:41     ` Thinh Nguyen
2024-08-15  1:18       ` Thinh Nguyen
2024-08-15  1:26         ` Thinh Nguyen

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=e26d660b-ce53-6208-d56b-b33a1d1b22be@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    --cc=stable@vger.kernel.org \
    /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®