Commit 59f3fcd9 authored by Roy Luo's avatar Roy Luo Committed by Venkatesh G (xWF)
Browse files

BACKPORT: usb: xhci: Skip xhci_reset in xhci_resume if xhci is being removed



xhci_reset() currently returns -ENODEV if XHCI_STATE_REMOVING is
set, without completing the xhci handshake, unless the reset completes
exceptionally quickly. This behavior causes a regression on Synopsys
DWC3 USB controllers with dual-role capabilities.

Specifically, when a DWC3 controller exits host mode and removes xhci
while a reset is still in progress, and then attempts to configure its
hardware for device mode, the ongoing, incomplete reset leads to
critical register access issues. All register reads return zero, not
just within the xHCI register space (which might be expected during a
reset), but across the entire DWC3 IP block.

This patch addresses the issue by preventing xhci_reset() from being
called in xhci_resume() and bailing out early in the reinit flow when
XHCI_STATE_REMOVING is set.

Cc: stable <stable@kernel.org>
Fixes: 6ccb83d6 ("usb: xhci: Implement xhci_handshake_check_state() helper")
Suggested-by: default avatarMathias Nyman <mathias.nyman@intel.com>
Signed-off-by: default avatarRoy Luo <royluo@google.com>
Link: https://lore.kernel.org/r/20250522190912.457583-2-royluo@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 425717664
Bug: 450494033
(cherry picked from commit 3eff494f)
[Roy: xhci_resume() function signature changes, no impact]
Change-Id: I859c3c560e64130e5cd67623f9c39dc31b094584
Signed-off-by: default avatarRoy Luo <royluo@google.com>
(cherry picked from commit 5b3ae3bc)
parent 9363533d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment