Linux USB
 help / color / mirror / Atom feed
* [PATCH 0/7] usb: dwc3: gadget: Fix No Resource after End Transfer
@ 2026-10-21  0:37 Thinh Nguyen
  2026-10-21  0:37 ` [PATCH 1/7] usb: dwc3: gadget: Reject requests to a disabled endpoint Thinh Nguyen
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Thinh Nguyen @ 2026-10-21  0:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Thinh Nguyen, Wesley Cheng, Michael Grzeschik
  Cc: Tejas Narendra Joglekar, linux-usb@vger.kernel.org,
	stable@vger.kernel.org, Michael Grzeschik, Selvarasu Ganesan

The dwc3 driver can issue a Start Transfer command while a previous End
Transfer command on the same endpoint has not completed. The controller then
rejects it with "No Resource", and the endpoint stays unusable.

This happens in two cases:
 * On ep disable, the End Transfer command is issued without interrupt and its
   completion isn't tracked. A quick re-enable or queue to the endpoint can
   race with it.
 * A timed out End Transfer is treated as done, and the endpoint resource index
   is lost.

This series tracks the End Transfer completion on ep disable and on timeout. It
also avoids an unneeded no-op Start Transfer on non-stream endpoints, and
rejects requests queued to an endpoint that is being disabled. If the End
Transfer never completes, the driver recovers through the existing error
recovery, and stale endpoint flags are reset on controller start.

Thanks to Selvarasu for reporting and debugging the issue.

Link: https://lore.kernel.org/linux-usb/20260227121236.963-1-selvarasu.g@samsung.com/



Thinh Nguyen (7):
  usb: dwc3: gadget: Reject requests to a disabled endpoint
  usb: dwc3: gadget: Track a timed out End Transfer
  usb: dwc3: gadget: Clear delayed stop on End Transfer completion
  usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints
  usb: dwc3: gadget: Wait for End Transfer completion on ep disable
  usb: dwc3: gadget: Reset endpoint flags on controller start
  usb: dwc3: gadget: Recover from End Transfer timeout

 drivers/usb/dwc3/core.h   |   4 +-
 drivers/usb/dwc3/ep0.c    |   2 +-
 drivers/usb/dwc3/gadget.c | 160 +++++++++++++++++++++++++-------------
 3 files changed, 109 insertions(+), 57 deletions(-)


base-commit: bdf12cde30830d46a8ef1ba93986356f1164b4f1
-- 
2.53.0

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-10-21  1:13 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21  0:37 [PATCH 0/7] usb: dwc3: gadget: Fix No Resource after End Transfer Thinh Nguyen
2026-10-21  0:37 ` [PATCH 1/7] usb: dwc3: gadget: Reject requests to a disabled endpoint Thinh Nguyen
2026-10-21  0:44   ` sashiko-bot
2026-10-21  0:37 ` [PATCH 2/7] usb: dwc3: gadget: Track a timed out End Transfer Thinh Nguyen
2026-10-21  0:43   ` sashiko-bot
2026-10-21  0:38 ` [PATCH 3/7] usb: dwc3: gadget: Clear delayed stop on End Transfer completion Thinh Nguyen
2026-10-21  0:58   ` sashiko-bot
2026-10-21  0:38 ` [PATCH 4/7] usb: dwc3: gadget: Issue no-op Start Transfer only for stream endpoints Thinh Nguyen
2026-10-21  0:48   ` sashiko-bot
2026-10-21  0:38 ` [PATCH 5/7] usb: dwc3: gadget: Wait for End Transfer completion on ep disable Thinh Nguyen
2026-10-21  1:13   ` sashiko-bot
2026-10-21  0:38 ` [PATCH 6/7] usb: dwc3: gadget: Reset endpoint flags on controller start Thinh Nguyen
2026-10-21  1:03   ` sashiko-bot
2026-10-21  0:38 ` [PATCH 7/7] usb: dwc3: gadget: Recover from End Transfer timeout Thinh Nguyen
2026-10-21  1:05   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox