FAILED: patch "[PATCH] usb: dwc3: gadget: Wait for End Transfer completion on ep" failed to apply to 5.15-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 1338410c21a5710b7ba88057034d35367ba0f054
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026112539-random-giddiness-30f2@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 1338410c21a5710b7ba88057034d35367ba0f054 Mon Sep 17 00:00:00 2001
From: Thinh Nguyen <[email protected]>
Date: Wed, 21 Oct 2026 00:38:13 +0000
Subject: [PATCH] usb: dwc3: gadget: Wait for End Transfer completion on ep
disable
The End Transfer command on ep disable is issued without interrupt, and the endpoint flags are cleared right after a fixed delay. The command may not have completed by then. If the function driver re-enables the endpoint and queues a request, the next Start Transfer fails with "No Resource".
Issue the End Transfer command with interrupt on ep disable, and keep DWC3_EP_END_TRANSFER_PENDING and DWC3_EP_TRANSFER_STARTED until the command completes. Defer the no-op Start Transfer of a stream endpoint re-enabled in the meantime to the command completion.
drivers/usb/dwc3/core.h +3 -1
@@ -771,6 +771,7 @@ struct dwc3_ep {#define DWC3_EP_TXFIFO_RESIZED BIT(12)#define DWC3_EP_DELAY_STOP BIT(13)#define DWC3_EP_RESOURCE_ALLOCATED BIT(14) +#define DWC3_EP_PENDING_NOOP_START BIT(15)/* This last one is specific to EP0 */ #define DWC3_EP0_DIR_IN BIT(31)
@@ -1695,7 +1696,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd,int dwc3_send_gadget_generic_command (struct dwc3 *dwc,unsigned int cmd,u32 param);void dwc3_gadget_clear_tx_fifos (struct dwc3 *dwc); -void dwc3_remove_requests (struct dwc3 *dwc,struct dwc3_ep *dep,int status); +void dwc3_remove_requests (struct dwc3 *dwc,struct dwc3_ep *dep,int status, +bool interrupt);#else static inline int dwc3_gadget_init (struct dwc3 *dwc) {return 0 ; }
drivers/usb/dwc3/ep0.c +1 -1
@@ -315,7 +315,7 @@ void dwc3_ep0_out_start(struct dwc3 *dwc)if (dwc->connected)dwc3_stop_active_transfer (dwc3_ep, false, true);else -dwc3_remove_requests (dwc, dwc3_ep, -ESHUTDOWN ); +dwc3_remove_requests (dwc, dwc3_ep, -ESHUTDOWN , false); } }
drivers/usb/dwc3/gadget.c +35 -7
87 lines not on this page · raw message