Skip to content

Commit f2e0eee

Browse files
Thinh Nguyengregkh
authored andcommitted
usb: dwc3: ep0: Don't reset resource alloc flag
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: stable@vger.kernel.org Fixes: b311048 ("usb: dwc3: gadget: Rewrite endpoint allocation flow") Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/00122b7cc5be06abef461776e7cc9f5ebc8bc1cb.1713229786.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1607830 commit f2e0eee

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
@@ -226,7 +226,8 @@ void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
226226

227227
/* reinitialize physical ep1 */
228228
dep = dwc->eps[1];
229-
dep->flags = DWC3_EP_ENABLED;
229+
dep->flags &= DWC3_EP_RESOURCE_ALLOCATED;
230+
dep->flags |= DWC3_EP_ENABLED;
230231

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

0 commit comments

Comments
 (0)