At Mon, 4 Jun 2012 16:39:38 +0800, Andiry Xu wrote: > > When system software decides to power down the xHC with the intent of > resuming operation at a later time, it will ask xHC to save the internal > state and restore it when resume to correctly recover from a power event. > Two bits are used to enable this operation: Save State and Restore State. > > xHCI spec 4.23.2 says software should "Set the Controller Save State(CSS) > flag in the USBCMD register and wait for the Save State Status(SSS) flag > in the USBSTS register to transition to '0'". However, it does not define > how long software should wait for the SSS bit to transition to 0. > > Currently the timeout is set to 1ms. There is bug report > (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1002697) > indicates that the timeout is too short for ASMedia ASM1042 host controller > to save the state successfully. Increase the timeout to 10ms helps to > resolve the issue. > > Signed-off-by: Andiry Xu <andiry.xu@xxxxxxxxx> > Cc: Ming Lei <ming.lei@xxxxxxxxxxxxx> > Cc: <stable@xxxxxxxxxxxxxxx> > --- > drivers/usb/host/xhci.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > index afdc73e..8d446af 100644 > --- a/drivers/usb/host/xhci.c > +++ b/drivers/usb/host/xhci.c > @@ -795,7 +795,7 @@ int xhci_suspend(struct xhci_hcd *xhci) > command = xhci_readl(xhci, &xhci->op_regs->command); > command |= CMD_CSS; > xhci_writel(xhci, command, &xhci->op_regs->command); > - if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10*100)) { > + if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 100*100)) { IMO, 10 * 1000 is clearer as a representation of 10 ms. (I guess 10 * 100 was a typo?) Takashi -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html