Commit 127efe3d authored by Ajay Gupta's avatar Ajay Gupta Committed by Kleber Sacilotto de Souza

usb: xhci: increase CRS timeout value

BugLink: https://bugs.launchpad.net/bugs/1792377

[ Upstream commit 305886ca ]

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: default avatarAjay Gupta <ajaykuee@gmail.com>
Signed-off-by: default avatarNagaraj Annaiah <naga.annaiah@gmail.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent b82efb12
...@@ -1055,8 +1055,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -1055,8 +1055,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
command = readl(&xhci->op_regs->command); command = readl(&xhci->op_regs->command);
command |= CMD_CRS; command |= CMD_CRS;
writel(command, &xhci->op_regs->command); writel(command, &xhci->op_regs->command);
/*
* Some controllers take up to 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, 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"); xhci_warn(xhci, "WARN: xHC restore state timeout\n");
spin_unlock_irq(&xhci->lock); spin_unlock_irq(&xhci->lock);
return -ETIMEDOUT; return -ETIMEDOUT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment