Skip to content

Commit 4cb99ee

Browse files
Thinh Nguyengregkh
authored andcommitted
usb: dwc3: ep0: Don't reset resource alloc flag
commit f2e0eee4703869dc5edb5302a919861566ca7797 upstream. 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]>
1 parent c807ab3 commit 4cb99ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/dwc3/ep0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
224224

225225
/* reinitialize physical ep1 */
226226
dep = dwc->eps[1];
227-
dep->flags = DWC3_EP_ENABLED;
227+
dep->flags &= DWC3_EP_RESOURCE_ALLOCATED;
228+
dep->flags |= DWC3_EP_ENABLED;
228229

229230
/* stall is always issued on EP0 */
230231
dep = dwc->eps[0];

0 commit comments

Comments
 (0)