diff mbox

usb: xhci: increase CRS timeout value

Message ID 1528397319-30510-1-git-send-email-ajaykuee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ajay Gupta June 7, 2018, 6:48 p.m. UTC
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

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

Comments

Oliver Neukum June 11, 2018, 8:50 a.m. UTC | #1
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
Mathias Nyman June 11, 2018, 12:05 p.m. UTC | #2
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 mbox

Patch

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;