linux/drivers/usb/dwc3
Selvarasu Ganesan 5a1a847d84 usb: dwc3: Remove WARN_ON for device endpoint command timeouts
commit 45eae113dc upstream.

This commit addresses a rarely observed endpoint command timeout
which causes kernel panic due to warn when 'panic_on_warn' is enabled
and unnecessary call trace prints when 'panic_on_warn' is disabled.
It is seen during fast software-controlled connect/disconnect testcases.
The following is one such endpoint command timeout that we observed:

1. Connect
   =======
->dwc3_thread_interrupt
 ->dwc3_ep0_interrupt
  ->configfs_composite_setup
   ->composite_setup
    ->usb_ep_queue
     ->dwc3_gadget_ep0_queue
      ->__dwc3_gadget_ep0_queue
       ->__dwc3_ep0_do_control_data
        ->dwc3_send_gadget_ep_cmd

2. Disconnect
   ==========
->dwc3_thread_interrupt
 ->dwc3_gadget_disconnect_interrupt
  ->dwc3_ep0_reset_state
   ->dwc3_ep0_end_control_data
    ->dwc3_send_gadget_ep_cmd

In the issue scenario, in Exynos platforms, we observed that control
transfers for the previous connect have not yet been completed and end
transfer command sent as a part of the disconnect sequence and
processing of USB_ENDPOINT_HALT feature request from the host timeout.
This maybe an expected scenario since the controller is processing EP
commands sent as a part of the previous connect. It maybe better to
remove WARN_ON in all places where device endpoint commands are sent to
avoid unnecessary kernel panic due to warn.

Cc: stable <stable@kernel.org>
Co-developed-by: Akash M <akash.m5@samsung.com>
Signed-off-by: Akash M <akash.m5@samsung.com>
Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/20250808125315.1607-1-selvarasu.g@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-08-28 16:26:15 +02:00
..
core.c usb: dwc3: Abort suspend on soft disconnect failure 2025-07-17 18:32:11 +02:00
core.h usb: dwc3: Set SUSPENDENABLE soon after phy init 2025-03-13 12:53:20 +01:00
debug.h USB: dwc3: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:36 +01:00
debugfs.c usb: dwc3: debugfs: Resume dwc3 before accessing registers 2023-05-24 17:32:48 +01:00
drd.c usb: dwc3: Set SUSPENDENABLE soon after phy init 2025-03-13 12:53:20 +01:00
dwc3-am62.c usb: dwc3-am62: Fix an OF node leak in phy_syscon_pll_refclk() 2025-02-21 13:49:26 +01:00
dwc3-exynos.c usb: dwc3: exynos: Fix remove() function 2022-11-22 16:51:45 +01: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 device leak at unbind 2025-08-28 16:26:12 +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 device leaks at unbind 2025-08-28 16:26:05 +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: add missing depopulate in probe error path 2024-09-04 13:25:03 +02:00
dwc3-pci.c usb: dwc3: gadget: Avoid using reserved endpoints on Intel Merrifield 2025-05-02 07:47:02 +02:00
dwc3-qcom.c usb: dwc3: qcom: Don't leave BCR asserted 2025-07-24 08:51:55 +02:00
dwc3-st.c usb: dwc3: st: add missing depopulate in probe error path 2024-09-04 13:25:03 +02:00
dwc3-xilinx.c usb: dwc3: xilinx: Prevent spike in reset signal 2025-05-02 07:46:59 +02:00
ep0.c usb: dwc3: Remove WARN_ON for device endpoint command timeouts 2025-08-28 16:26:15 +02:00
gadget.c usb: dwc3: Remove WARN_ON for device endpoint command timeouts 2025-08-28 16:26:15 +02:00
gadget.h usb: dwc3: gadget: Rewrite endpoint allocation flow 2024-12-14 19:54:24 +01:00
host.c usb: dwc3: core: Prevent phy suspend during init 2024-05-17 11:56:18 +02:00
io.h usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
Kconfig usb: dwc3: fix extcon dependency 2023-02-01 08:34:25 +01:00
Makefile drivers: usb: dwc3: Add AM62 USB wrapper driver 2022-04-21 18:31:56 +02: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: add Start of Frame Number to trace event 2022-08-19 11:03:52 +02:00
ulpi.c usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression 2020-12-28 15:55:44 +01:00