All of lore.kernel.org
 help / color / mirror / Atom feed
* [v2] usb: xhci: increase CRS timeout value
@ 2018-06-11 21:05 Ajay Gupta
  0 siblings, 0 replies; only message in thread
From: Ajay Gupta @ 2018-06-11 21:05 UTC (permalink / raw)
  To: linux-usb
  Cc: felipe.balbi, oneukum, mathias.nyman, Ajay Gupta, Nagaraj Annaiah

Some controllers take almost 55ms to complete controller
restore state (CRS).
There is no timeout limit mentioned in xhci specification so
fixing the issue by increasing the timeout limit to 55ms

Signed-off-by: Ajay Gupta <ajaykuee@gmail.com>
Signed-off-by: Nagaraj Annaiah <naga.annaiah@gmail.com>
---
 drivers/usb/host/xhci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 8c8da2d..fa7bd71 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1043,8 +1043,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 		command = readl(&xhci->op_regs->command);
 		command |= CMD_CRS;
 		writel(command, &xhci->op_regs->command);
+		/* Some controllers take upto 55+ ms to complete
+		 * the controller restore so setting the timeout to
+		 * 100ms. Xhci specification doesn't mention any
+		 * timeout value.
+		 */
 		if (xhci_handshake(&xhci->op_regs->status,
-			      STS_RESTORE, 0, 10 * 1000)) {
+			      STS_RESTORE, 0, 100 * 1000)) {
 			xhci_warn(xhci, "WARN: xHC restore state timeout\n");
 			spin_unlock_irq(&xhci->lock);
 			return -ETIMEDOUT;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-11 21:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11 21:05 [v2] usb: xhci: increase CRS timeout value Ajay Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.