public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Introduce XHCI_FULL_RESET_ON_REMOVE quirk for DWC3
@ 2025-05-15 18:52 Roy Luo
  2025-05-15 18:52 ` [PATCH v2 1/2] xhci: Add a quirk for full reset on removal Roy Luo
  2025-05-15 18:52 ` [PATCH v2 2/2] usb: dwc3: Force full reset on xhci removal Roy Luo
  0 siblings, 2 replies; 9+ messages in thread
From: Roy Luo @ 2025-05-15 18:52 UTC (permalink / raw)
  To: royluo, mathias.nyman, quic_ugoswami, Thinh.Nguyen, gregkh,
	linux-usb, linux-kernel

Commit 6ccb83d6c497 ("usb: xhci: Implement xhci_handshake_check_state()
helper") introduced an optimization to xhci_reset() during xhci removal,
allowing it to bail out early without waiting for the reset to complete.

This behavior can cause issues on SNPS DWC3 USB controller with dual-role
capability. When the DWC3 controller exits host mode and removes xhci
while a reset is still in progress, and then tries to configure its
hardware for device mode, the ongoing reset leads to register access
issues; specifically, all register reads returns 0. These issues extend
beyond the xhci register space (which is expected during a reset) and
affect the entire DWC3 IP block, causing the DWC3 device mode to
malfunction.

To fix this, introduce XHCI_FULL_RESET_ON_REMOVE quirk andd enable it on
DWC3. This ensures xhci_reset() completes its full handshake before
proceeding.

---
Changes in v2:
- no code change
- add Fixes tag and cc stable kernel
Link to v1: https://lore.kernel.org/r/20250515040207.1253690-1-royluo@google.com/
---

Roy Luo (2):
  xhci: Add a quirk for full reset on removal
  usb: dwc3: Force full reset on xhci removal

 drivers/usb/dwc3/host.c      | 5 ++++-
 drivers/usb/host/xhci-plat.c | 3 +++
 drivers/usb/host/xhci.c      | 8 +++++++-
 drivers/usb/host/xhci.h      | 1 +
 4 files changed, 15 insertions(+), 2 deletions(-)


base-commit: c94d59a126cb9a8d1f71e3e044363d654dcd7af8
-- 
2.49.0.1112.g889b7c5bd8-goog


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-05-17  4:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-15 18:52 [PATCH v2 0/2] Introduce XHCI_FULL_RESET_ON_REMOVE quirk for DWC3 Roy Luo
2025-05-15 18:52 ` [PATCH v2 1/2] xhci: Add a quirk for full reset on removal Roy Luo
2025-05-15 23:42   ` Thinh Nguyen
2025-05-16  6:33     ` Michał Pecio
2025-05-16 23:11       ` Roy Luo
2025-05-16 23:38         ` Thinh Nguyen
2025-05-17  0:50           ` Roy Luo
2025-05-17  4:39           ` Michał Pecio
2025-05-15 18:52 ` [PATCH v2 2/2] usb: dwc3: Force full reset on xhci removal Roy Luo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox