linux-stable/drivers/usb/dwc3
Wesley Cheng 4a1e25c0a0 usb: dwc3: gadget: Stop EP0 transfers during pullup disable
During a USB cable disconnect, or soft disconnect scenario, a pending
SETUP transaction may not be completed, leading to the following
error:

    dwc3 a600000.dwc3: timed out waiting for SETUP phase

If this occurs, then the entire pullup disable routine is skipped and
proper cleanup and halting of the controller does not complete.

Instead of returning an error (which is ignored from the UDC
perspective), allow the pullup disable routine to continue, which
will also handle disabling of EP0/1.  This will end any active
transfers as well.  Ensure to clear any delayed_status also, as the
timeout could happen within the STATUS stage.

Fixes: bb01473648 ("usb: dwc3: gadget: don't clear RUN/STOP when it's invalid to do so")
Cc: <stable@vger.kernel.org>
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/20210825042855.7977-1-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 13:48:58 +02:00
..
core.c usb: dwc3: Fix debugfs creation flow 2021-06-21 11:28:18 +02:00
core.h usb: dwc3: avoid NULL access of usb_gadget_driver 2021-07-21 09:47:32 +02:00
debug.h usb: dwc3: debugfs: Add and remove endpoint dirs dynamically 2021-06-03 20:28:23 +02:00
debugfs.c USB: dwc3: remove debugfs root dentry storage 2021-06-10 19:57:21 +02:00
drd.c usb: dwc3: remove repeated setting of current_dr_role 2021-05-10 11:16:11 +02:00
dwc3-exynos.c usb: dwc3: exynos: fix incorrect kernel-doc comment syntax 2021-04-02 15:20:54 +02:00
dwc3-haps.c usb: dwc3: haps: Constify the software node 2021-02-04 15:42:06 +01:00
dwc3-imx8mp.c usb: dwc3: imx8mp: fix error return code in dwc3_imx8mp_probe() 2021-05-10 14:58:41 +02:00
dwc3-keystone.c usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
dwc3-meson-g12a.c usb: dwc3-meson-g12a: fix usb2 PHY glue init when phy0 is disabled 2021-06-04 12:58:55 +02:00
dwc3-of-simple.c usb: dwc3: Add driver for Xilinx platforms 2021-03-23 12:48:14 +01:00
dwc3-omap.c usb: dwc3: omap: improve extcon initialization 2021-05-10 15:04:37 +02:00
dwc3-pci.c Merge 5.13-rc2 into usb-next 2021-05-17 09:45:58 +02:00
dwc3-qcom.c usb: dwc3: qcom: Detect DWC3 DT-nodes using compatible string 2021-04-10 10:46:09 +02:00
dwc3-st.c usb: dwc3: st: fix incorrect kernel-doc comment syntax in file 2021-04-02 15:20:46 +02:00
dwc3-xilinx.c usb: dwc3: xilinx: Remove the extra freeing of clocks 2021-04-09 16:05:32 +02:00
ep0.c usb: dwc3: avoid NULL access of usb_gadget_driver 2021-07-21 09:47:32 +02:00
gadget.c usb: dwc3: gadget: Stop EP0 transfers during pullup disable 2021-08-26 13:48:58 +02:00
gadget.h usb: dwc3: add cancelled reasons for dwc3 requests 2021-04-02 15:27:36 +02:00
host.c usb: dwc3: host: Use software node API with the properties 2021-02-05 10:08:19 +01:00
io.h usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
Kconfig usb: dwc3: Add driver for Xilinx platforms 2021-03-23 12:48:14 +01:00
Makefile usb: dwc3: Add driver for Xilinx platforms 2021-03-23 12:48:14 +01:00
trace.c usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
trace.h usb: dwc3: trace: Remove unused fields in dwc3_log_trb 2021-05-27 09:30:01 +02:00
ulpi.c usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression 2020-12-28 15:55:44 +01:00