]> Git Repo - linux.git/commitdiff
usb: dwc3: ep0: Don't reset resource alloc flag
authorThinh Nguyen <[email protected]>
Tue, 16 Apr 2024 01:23:07 +0000 (01:23 +0000)
committerGreg Kroah-Hartman <[email protected]>
Thu, 18 Apr 2024 14:42:21 +0000 (16:42 +0200)
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.

Cc: [email protected]
Fixes: b311048c174d ("usb: dwc3: gadget: Rewrite endpoint allocation flow")
Signed-off-by: Thinh Nguyen <[email protected]>
Link: https://lore.kernel.org/r/00122b7cc5be06abef461776e7cc9f5ebc8bc1cb.1713229786.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/usb/dwc3/ep0.c

index 72bb722da2f258fb07fa7701bbe07b7509f1c15a..d96ffbe520397ad1a66ff661a01530ce017de9f3 100644 (file)
@@ -226,7 +226,8 @@ void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
 
        /* reinitialize physical ep1 */
        dep = dwc->eps[1];
-       dep->flags = DWC3_EP_ENABLED;
+       dep->flags &= DWC3_EP_RESOURCE_ALLOCATED;
+       dep->flags |= DWC3_EP_ENABLED;
 
        /* stall is always issued on EP0 */
        dep = dwc->eps[0];
This page took 0.056137 seconds and 4 git commands to generate.