summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Jun <jun.li@nxp.com>2020-12-08 11:29:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-21 13:28:19 +0100
commitec157cdb5bb539cc8888f655bd7e5c27d3a6c70e (patch)
tree9418f2347a3ed94d2f1417874a1fefea95d4e896
parent372b0f393a71657646eec9b59310432117871a9f (diff)
downloadlinux-stable-ec157cdb5bb539cc8888f655bd7e5c27d3a6c70e.tar.gz
linux-stable-ec157cdb5bb539cc8888f655bd7e5c27d3a6c70e.tar.bz2
linux-stable-ec157cdb5bb539cc8888f655bd7e5c27d3a6c70e.zip
xhci: Give USB2 ports time to enter U3 in bus suspend
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>
-rw-r--r--drivers/usb/host/xhci-hub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index c799ca5361d4..74c497fd3476 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -1712,6 +1712,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;
}