linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xhci: Increase STS_SAVE timeout in xhci_suspend()
@ 2019-09-26 17:57 Kai-Heng Feng
  2019-09-27  6:30 ` Mathias Nyman
  0 siblings, 1 reply; 2+ messages in thread
From: Kai-Heng Feng @ 2019-09-26 17:57 UTC (permalink / raw)
  To: mathias.nyman, gregkh; +Cc: linux-usb, linux-kernel, Kai-Heng Feng

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(-)

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
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] xhci: Increase STS_SAVE timeout in xhci_suspend()
  2019-09-26 17:57 [PATCH] xhci: Increase STS_SAVE timeout in xhci_suspend() Kai-Heng Feng
@ 2019-09-27  6:30 ` Mathias Nyman
  0 siblings, 0 replies; 2+ messages in thread
From: Mathias Nyman @ 2019-09-27  6:30 UTC (permalink / raw)
  To: Kai-Heng Feng, mathias.nyman, gregkh; +Cc: linux-usb, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-27  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 17:57 [PATCH] xhci: Increase STS_SAVE timeout in xhci_suspend() Kai-Heng Feng
2019-09-27  6:30 ` Mathias Nyman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).