Commit 4b9c60e4 authored by Mario Limonciello's avatar Mario Limonciello Committed by Greg Kroah-Hartman
Browse files

usb: xhci: Avoid showing errors during surprise removal



When a USB4 dock is unplugged from a system it won't respond to ring
events. The PCI core handles the surprise removal event and notifies
all PCI drivers. The XHCI PCI driver sets a flag that the device is
being removed as well.

When that flag is set don't show messages in the cleanup path for
marking the controller dead.

Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Acked-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250717073107.488599-2-mathias.nyman@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 300386d1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1376,11 +1376,14 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci,
 */
void xhci_hc_died(struct xhci_hcd *xhci)
{
	bool notify;
	int i, j;

	if (xhci->xhc_state & XHCI_STATE_DYING)
		return;

	notify = !(xhci->xhc_state & XHCI_STATE_REMOVING);
	if (notify)
		xhci_err(xhci, "xHCI host controller not responding, assume dead\n");
	xhci->xhc_state |= XHCI_STATE_DYING;

@@ -1395,7 +1398,7 @@ void xhci_hc_died(struct xhci_hcd *xhci)
	}

	/* inform usb core hc died if PCI remove isn't already handling it */
	if (!(xhci->xhc_state & XHCI_STATE_REMOVING))
	if (notify)
		usb_hc_died(xhci_to_hcd(xhci));
}