This is a note to let you know that I've just added the patch titled usb: dwc3: gadget: Force sending delayed status during soft disconnect to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-dwc3-gadget-force-sending-delayed-status-during-soft-disconnect.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e1ee843488d58099a89979627ef85d5bd6c5cacd Mon Sep 17 00:00:00 2001 From: Wesley Cheng <quic_wcheng@xxxxxxxxxxx> Date: Wed, 17 Aug 2022 11:23:52 -0700 Subject: usb: dwc3: gadget: Force sending delayed status during soft disconnect From: Wesley Cheng <quic_wcheng@xxxxxxxxxxx> commit e1ee843488d58099a89979627ef85d5bd6c5cacd upstream. If any function drivers request for a delayed status phase, this leads to a SETUP transfer timeout error, since the function may take longer to process the DATA stage. This eventually results in end transfer timeouts, as there is a pending SETUP transaction. In addition, allow the DWC3_EP_DELAY_STOP to be set for if there is a delayed status requested. Ocasionally, a host may abort the current SETUP transaction, by issuing a subsequent SETUP token. In those situations, it would result in an endxfer timeout as well. Reviewed-by: Thinh Nguyen <Thinh.Nguyen@xxxxxxxxxxxx> Signed-off-by: Wesley Cheng <quic_wcheng@xxxxxxxxxxx> Link: https://lore.kernel.org/r/20220817182359.13550-3-quic_wcheng@xxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/dwc3/gadget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2501,6 +2501,9 @@ static int dwc3_gadget_soft_disconnect(s if (dwc->ep0state != EP0_SETUP_PHASE) { int ret; + if (dwc->delayed_status) + dwc3_ep0_send_delayed_status(dwc); + reinit_completion(&dwc->ep0_in_setup); spin_unlock_irqrestore(&dwc->lock, flags); @@ -3699,7 +3702,7 @@ void dwc3_stop_active_transfer(struct dw * timeout. Delay issuing the End Transfer command until the Setup TRB is * prepared. */ - if (dwc->ep0state != EP0_SETUP_PHASE && !dwc->delayed_status) { + if (dwc->ep0state != EP0_SETUP_PHASE) { dep->flags |= DWC3_EP_DELAY_STOP; return; } Patches currently in stable-queue which might be from quic_wcheng@xxxxxxxxxxx are queue-6.0/usb-dwc3-gadget-force-sending-delayed-status-during-soft-disconnect.patch