diff mbox series

xhci: Increase STS_SAVE timeout in xhci_suspend()

Message ID 20190926175722.2507-1-kai.heng.feng@canonical.com (mailing list archive)
State Mainlined
Commit ac343366846a445bb81f0a0e8f16abb8bd5d5d88
Headers show
Series xhci: Increase STS_SAVE timeout in xhci_suspend() | expand

Commit Message

Kai-Heng Feng Sept. 26, 2019, 5:57 p.m. UTC
After commit f7fac17ca925 ("xhci: Convert xhci_handshake() to use
readl_poll_timeout_atomic()"), ASMedia xHCI may fail to suspend.

Although the algorithms are essentially the same, the old max timeout is
(usec + usec * time of doing readl()), and the new max timeout is just
usec, which is much less than the old one.

Increase the timeout to make ASMedia xHCI able to suspend again.

BugLink: https://bugs.launchpad.net/bugs/1844021
Fixes: f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/usb/host/xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mathias Nyman Sept. 27, 2019, 6:30 a.m. UTC | #1
On 26.9.2019 20.57, Kai-Heng Feng wrote:
> After commit f7fac17ca925 ("xhci: Convert xhci_handshake() to use
> readl_poll_timeout_atomic()"), ASMedia xHCI may fail to suspend.
> 
> Although the algorithms are essentially the same, the old max timeout is
> (usec + usec * time of doing readl()), and the new max timeout is just
> usec, which is much less than the old one.
> 
> Increase the timeout to make ASMedia xHCI able to suspend again.
> 
> BugLink: https://bugs.launchpad.net/bugs/1844021
> Fixes: f7fac17ca925 ("xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()")
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---

Thanks, adding to queue with stable tag for v5.2+ kernels

-Mathias
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 559b639337fb..100493eb9691 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1032,7 +1032,7 @@  int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
 	writel(command, &xhci->op_regs->command);
 	xhci->broken_suspend = 0;
 	if (xhci_handshake(&xhci->op_regs->status,
-				STS_SAVE, 0, 10 * 1000)) {
+				STS_SAVE, 0, 20 * 1000)) {
 	/*
 	 * AMD SNPS xHC 3.0 occasionally does not clear the
 	 * SSS bit of USBSTS and when driver tries to poll