xhci: Add usb cold attach (CAS) as a reason to resume root hub.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 2 Jun 2023 14:40:00 +0000 (17:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Jun 2023 09:34:49 +0000 (11:34 +0200)
Check for the cold attach (CAS) bit while checking for other usb3
roothub port changes during host resume.

The CAS bit is set if a USB 3 device is connected while the host is
suspended in such a way it can't perform proper link training and
progress the link to the enabled U0 state.

If the CAS bit set we want to resume the root hub, and reset and
enumerate the newly connected device.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-3-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c

index b81313ffeb768e95327eb1bf8d4b01bcee2a334a..3a13e2453203ccf3d2a37616663bf59821093c64 100644 (file)
@@ -833,7 +833,7 @@ static bool xhci_pending_portevent(struct xhci_hcd *xhci)
        ports = xhci->usb3_rhub.ports;
        while (port_index--) {
                portsc = readl(ports[port_index]->addr);
-               if (portsc & PORT_CHANGE_MASK ||
+               if (portsc & (PORT_CHANGE_MASK | PORT_CAS) ||
                    (portsc & PORT_PLS_MASK) == XDEV_RESUME)
                        return true;
        }