linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Increase XHCI suspend timeout to 16ms
@ 2012-09-14 17:05 Michael Spang
  2012-09-17 17:56 ` Sarah Sharp
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Spang @ 2012-09-14 17:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-usb, Greg Kroah-Hartman, Sarah Sharp, Michael Spang

The Intel XHCI specification says that after clearing the run/stop bit
the controller may take up to 16ms to halt. We've seen a device take
14ms, which with the current timeout of 10ms causes the kernel to
abort the suspend. Increasing the timeout to the recommended value
fixes the problem.

Signed-off-by: Michael Spang <spang@chromium.org>
---
 drivers/usb/host/xhci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index c59d5b5..7710ccf 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -785,7 +785,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
 	command &= ~CMD_RUN;
 	xhci_writel(xhci, command, &xhci->op_regs->command);
 	if (handshake(xhci, &xhci->op_regs->status,
-		      STS_HALT, STS_HALT, 100*100)) {
+		      STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC)) {
 		xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n");
 		spin_unlock_irq(&xhci->lock);
 		return -ETIMEDOUT;
-- 
1.7.7.3


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

* Re: [PATCH] Increase XHCI suspend timeout to 16ms
  2012-09-14 17:05 [PATCH] Increase XHCI suspend timeout to 16ms Michael Spang
@ 2012-09-17 17:56 ` Sarah Sharp
  0 siblings, 0 replies; 2+ messages in thread
From: Sarah Sharp @ 2012-09-17 17:56 UTC (permalink / raw)
  To: Michael Spang; +Cc: linux-kernel, linux-usb, Greg Kroah-Hartman

On Fri, Sep 14, 2012 at 01:05:49PM -0400, Michael Spang wrote:
> The Intel XHCI specification says that after clearing the run/stop bit
> the controller may take up to 16ms to halt. We've seen a device take
> 14ms, which with the current timeout of 10ms causes the kernel to
> abort the suspend. Increasing the timeout to the recommended value
> fixes the problem.

Thanks for tracking this down, Michael.  I'll queue this to Greg in a
couple days.

> 
> Signed-off-by: Michael Spang <spang@chromium.org>
> ---
>  drivers/usb/host/xhci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index c59d5b5..7710ccf 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -785,7 +785,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
>  	command &= ~CMD_RUN;
>  	xhci_writel(xhci, command, &xhci->op_regs->command);
>  	if (handshake(xhci, &xhci->op_regs->status,
> -		      STS_HALT, STS_HALT, 100*100)) {
> +		      STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC)) {
>  		xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n");
>  		spin_unlock_irq(&xhci->lock);
>  		return -ETIMEDOUT;
> -- 
> 1.7.7.3
> 

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

end of thread, other threads:[~2012-09-17 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-14 17:05 [PATCH] Increase XHCI suspend timeout to 16ms Michael Spang
2012-09-17 17:56 ` Sarah Sharp

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