]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
xhci: Give USB2 ports time to enter U3 in bus suspend
authorLi Jun <jun.li@nxp.com>
Tue, 8 Dec 2020 09:29:12 +0000 (11:29 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 20 Jan 2021 13:25:17 +0000 (14:25 +0100)
BugLink: https://bugs.launchpad.net/bugs/1910817
commit c1373f10479b624fb6dba0805d673e860f1b421d upstream.

If a USB2 device wakeup is not enabled/supported the link state may
still be in U0 in xhci_bus_suspend(), where it's then manually put
to suspended U3 state.

Just as with selective suspend the device needs time to enter U3
suspend before continuing with further suspend operations
(e.g. system suspend), otherwise we may enter system suspend with link
state in U0.

[commit message rewording -Mathias]

Cc: <stable@vger.kernel.org>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20201208092912.1773650-6-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/usb/host/xhci-hub.c

index 933936abb6fb7add83b2817074acf505344e774e..1a274f8a5bf116ca96f1acceabfaf63ceaf3d47c 100644 (file)
@@ -1705,6 +1705,10 @@ retry:
        hcd->state = HC_STATE_SUSPENDED;
        bus_state->next_statechange = jiffies + msecs_to_jiffies(10);
        spin_unlock_irqrestore(&xhci->lock, flags);
+
+       if (bus_state->bus_suspended)
+               usleep_range(5000, 10000);
+
        return 0;
 }