Skip to content

Commit

Permalink
usb: dwc3: ep0: Don't reset resource alloc flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thinh Nguyen authored and Greg Kroah-Hartman committed Apr 18, 2024
1 parent 1607830 commit f2e0eee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/dwc3/ep0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit f2e0eee

Please sign in to comment.