Message ID | 1528397319-30510-1-git-send-email-ajaykuee@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Do, 2018-06-07 at 11:48 -0700, Ajay Gupta wrote: > Some controllers take almost 55ms to complete controller > restore state (CRS). > There is no timeout limit mentioned in xhci specification so > fix the issue by increasing the timeout limit to 55ms Hi, the chances that you saw the true worst case are slim. I would suggest you include at least a bit of a safety margin and a comment that explains it. Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11.06.2018 11:50, Oliver Neukum wrote: > On Do, 2018-06-07 at 11:48 -0700, Ajay Gupta wrote: >> Some controllers take almost 55ms to complete controller >> restore state (CRS). >> There is no timeout limit mentioned in xhci specification so >> fix the issue by increasing the timeout limit to 55ms > > Hi, > > the chances that you saw the true worst case are slim. > I would suggest you include at least a bit of a safety margin > and a comment that explains it. > > Regards > Oliver > Agree with this, polling up to 100ms perhaps? -Mathias -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 8c8da2d..44b1af5 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1044,7 +1044,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) command |= CMD_CRS; writel(command, &xhci->op_regs->command); if (xhci_handshake(&xhci->op_regs->status, - STS_RESTORE, 0, 10 * 1000)) { + STS_RESTORE, 0, 55 * 1000)) { xhci_warn(xhci, "WARN: xHC restore state timeout\n"); spin_unlock_irq(&xhci->lock); return -ETIMEDOUT;