linux-stable/drivers/usb/dwc3
Prashanth K 4a387e0329 usb: dwc3: Wait unconditionally after issuing EndXfer command
commit 1d26ba0944 upstream.

Currently all controller IP/revisions except DWC3_usb3 >= 310a
wait 1ms unconditionally for ENDXFER completion when IOC is not
set. This is because DWC_usb3 controller revisions >= 3.10a
supports GUCTL2[14: Rst_actbitlater] bit which allows polling
CMDACT bit to know whether ENDXFER command is completed.

Consider a case where an IN request was queued, and parallelly
soft_disconnect was called (due to ffs_epfile_release). This
eventually calls stop_active_transfer with IOC cleared, hence
send_gadget_ep_cmd() skips waiting for CMDACT cleared during
EndXfer. For DWC3 controllers with revisions >= 310a, we don't
forcefully wait for 1ms either, and we proceed by unmapping the
requests. If ENDXFER didn't complete by this time, it leads to
SMMU faults since the controller would still be accessing those
requests.

Fix this by ensuring ENDXFER completion by adding 1ms delay in
__dwc3_stop_active_transfer() unconditionally.

Cc: stable@vger.kernel.org
Fixes: b353eb6dc2 ("usb: dwc3: gadget: Skip waiting for CMDACT cleared during endxfer")
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20240502044103.1066350-1-quic_prashk@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-25 16:28:39 +02:00
..
core.c usb: dwc3: core: Prevent phy suspend during init 2024-05-17 12:14:59 +02:00
core.h usb: dwc3: core: Prevent phy suspend during init 2024-05-17 12:14:59 +02:00
debug.h usb: dwc3: Add function suspend and function wakeup support 2023-03-29 10:27:01 +02:00
debugfs.c usb: dwc3: debugfs: Resume dwc3 before accessing registers 2023-05-13 17:56:22 +09:00
drd.c usb: dwc3: Fix default mode initialization 2023-11-21 15:27:40 +01:00
dwc3-am62.c usb: dwc3-am62: Disable wakeup at remove 2024-04-03 15:32:12 +02:00
dwc3-exynos.c usb: dwc3: exynos: Add support for Exynos850 variant 2023-08-22 14:47:22 +02:00
dwc3-haps.c
dwc3-imx8mp.c usb: dwc3: imx8mp: Fix smatch warning 2023-12-15 18:27:40 +01:00
dwc3-keystone.c usb: dwc3: remove unnecessary platform_set_drvdata() 2023-08-22 14:45:19 +02:00
dwc3-meson-g12a.c usb: dwc3: meson-g12a: do post init to fix broken usb after resumption 2023-08-22 14:44:09 +02:00
dwc3-octeon.c just cleanups and fixes 2023-09-07 10:35:14 -07:00
dwc3-of-simple.c usb: dwc3: dwc3-octeon: Convert to glue driver 2023-08-04 14:52:15 +02:00
dwc3-omap.c usb: dwc3-omap: Convert to platform remove callback returning void 2023-05-28 12:36:24 +01:00
dwc3-pci.c usb: dwc3: pci: Drop duplicate ID 2024-04-03 15:32:50 +02:00
dwc3-qcom.c usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq 2024-01-04 16:04:50 +01:00
dwc3-rtk.c usb: dwc3: add missing of_node_put and platform_device_put 2023-11-21 15:30:43 +01:00
dwc3-st.c usb: dwc3-st: Convert to platform remove callback returning void 2023-05-28 12:36:24 +01:00
dwc3-xilinx.c usb: dwc3: xilinx: improve error handling for PM APIs 2023-12-15 13:52:29 +01:00
ep0.c usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart 2024-01-04 15:57:45 +01:00
gadget.c usb: dwc3: Wait unconditionally after issuing EndXfer command 2024-05-25 16:28:39 +02:00
gadget.h Revert "usb: dwc3: Support EBC feature of DWC_usb31" 2024-02-09 10:26:08 +00:00
host.c usb: dwc3: core: Prevent phy suspend during init 2024-05-17 12:14:59 +02:00
io.h
Kconfig usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer driver 2023-10-02 14:05:24 +02:00
Makefile usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer driver 2023-10-02 14:05:24 +02:00
trace.c
trace.h usb: dwc3: change some trace event __dynamic_array() to __get_buf() 2023-03-09 15:35:03 +01:00
ulpi.c