Skip to content

Commit 72fca83

Browse files
mgrzeschikgregkh
authored andcommitted
usb: dwc3: ep0: Don't reset resource alloc flag (including ep0)
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 f2e0eee ("usb: dwc3: ep0: Don't reset resource alloc flag") 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: [email protected] Fixes: b311048 ("usb: dwc3: gadget: Rewrite endpoint allocation flow") Acked-by: Thinh Nguyen <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3a8839b commit 72fca83

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
@@ -232,7 +232,8 @@ void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
232232
/* stall is always issued on EP0 */
233233
dep = dwc->eps[0];
234234
__dwc3_gadget_ep_set_halt(dep, 1, false);
235-
dep->flags = DWC3_EP_ENABLED;
235+
dep->flags &= DWC3_EP_RESOURCE_ALLOCATED;
236+
dep->flags |= DWC3_EP_ENABLED;
236237
dwc->delayed_status = false;
237238

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

0 commit comments

Comments
 (0)