aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAjay Gupta <ajaykuee@gmail.com>2018-06-21 09:19:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-25 09:16:27 -0400
commit305886ca87be480ae159908c2affd135c04215cf (patch)
tree1ff1debf54a4a2b48f3bcdb0aa7c01b726b938af
parent3431a150fd89bc74cd2f2aaf6977cc0e278fb445 (diff)
usb: xhci: increase CRS timeout value
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 100ms [reformat code comment -Mathias] Signed-off-by: Ajay Gupta <ajaykuee@gmail.com> Signed-off-by: Nagaraj Annaiah <naga.annaiah@gmail.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index f11ec61bcc7d..2f4850f25e82 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1078,8 +1078,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1078 command = readl(&xhci->op_regs->command); 1078 command = readl(&xhci->op_regs->command);
1079 command |= CMD_CRS; 1079 command |= CMD_CRS;
1080 writel(command, &xhci->op_regs->command); 1080 writel(command, &xhci->op_regs->command);
1081 /*
1082 * Some controllers take up to 55+ ms to complete the controller
1083 * restore so setting the timeout to 100ms. Xhci specification
1084 * doesn't mention any timeout value.
1085 */
1081 if (xhci_handshake(&xhci->op_regs->status, 1086 if (xhci_handshake(&xhci->op_regs->status,
1082 STS_RESTORE, 0, 10 * 1000)) { 1087 STS_RESTORE, 0, 100 * 1000)) {
1083 xhci_warn(xhci, "WARN: xHC restore state timeout\n"); 1088 xhci_warn(xhci, "WARN: xHC restore state timeout\n");
1084 spin_unlock_irq(&xhci->lock); 1089 spin_unlock_irq(&xhci->lock);
1085 return -ETIMEDOUT; 1090 return -ETIMEDOUT;