[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c0e06e73-f6d1-1943-fc83-2cf742280398@omp.ru>
Date: Wed, 14 Aug 2024 23:42:01 +0300
From: Sergey Shtylyov <s.shtylyov@....ru>
To: Michael Grzeschik <m.grzeschik@...gutronix.de>, Thinh Nguyen
<Thinh.Nguyen@...opsys.com>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<stable@...r.kernel.org>
Subject: Re: [PATCH] usb: dwc3: ep0: Don't reset resource alloc flag
(including ep0)
On 8/14/24 8:39 PM, Michael Grzeschik 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@...r.kernel.org
> Fixes: b311048c174d ("usb: dwc3: gadget: Rewrite endpoint allocation flow")
> Signed-off-by: Michael Grzeschik <m.grzeschik@...gutronix.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 &=?
[...]
MBR, Sergey
Powered by blists - more mailing lists