Re: [PATCH] usb: dwc3: ep0: Don't reset resource alloc flag (including ep0)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 14, 2024, Thinh Nguyen wrote:
> Hi Michael,
> 
> On Wed, Aug 14, 2024, Sergey Shtylyov wrote:
> > 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@xxxxxxxxxxxxxxx
> > >> Fixes: b311048c174d ("usb: dwc3: gadget: Rewrite endpoint allocation flow")
> > >> Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> 
> Thanks for the catch!
> 
> If you send v2 for the double quote fix in the commit message, you can
> include this:
> 
> Acked-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx>
> 

Actually, please ignore the Ack. Please do this instead:

diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index d96ffbe52039..9b069c4663a1 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -232,7 +232,7 @@ 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_STALL;
        dwc->delayed_status = false;

        if (!list_empty(&dep->pending_list)) {


We don't want to clear other flags such as wedge flag.

BR,
Thinh




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux