Re: ASM1042 SuperSpeed controller[1b21:1042] prevents system from suspending

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/11/2012 03:50 PM, Ming Lei wrote:
> On Mon, Jun 4, 2012 at 3:12 PM, Ming Lei <ming.lei@xxxxxxxxxxxxx> wrote:
>> On Thu, May 31, 2012 at 8:42 PM, Ming Lei <ming.lei@xxxxxxxxxxxxx> wrote:
>>> On Thu, May 31, 2012 at 3:55 PM, Xu, Andiry <Andiry.Xu@xxxxxxx> wrote:
>>>>
>>>> Try the patch attached.
>>>> You can modify the timeout to some bigger value (microsecond).
>>>
>>> Andiry, thanks for your quick response.
>>>
>>> I have asked the guy who reported the problem to test your patch,
>>> and will post the result once it is done.
>>
>> Andiry, thanks.
>>
>> The guy has confirmed[1] that your patch does fix the problem, so hope
>> this one can be merged.
> 
> 
> Unfortunately, there are timeout failure during resume path, see the log:
> 
> [  191.581754] xhci_hcd 0000:05:00.0: setting latency timer to 64
> [  191.584900] xhci_hcd 0000:05:00.0: PCI post-resume error -110!
> [  191.584902] xhci_hcd 0000:05:00.0: HC died; cleaning up
> [  191.584904] xhci_hcd 0000:05:00.0: HC died; cleaning up
> [  191.584909] pm_op(): pci_pm_resume+0x0/0xb0 returns -110
> [  191.584920] PM: Device 0000:05:00.0 failed to resume async: error -110
> 
> See[1] for detailed dmesg.
> 
> [1], https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1002697/comments/62
> 

Please revert the last patch and apply this one (which merged the last
patch).

Thanks,
Andiry

>From b41b91af7a6fcaefa174c6b3161d6dfc93a767f5 Mon Sep 17 00:00:00 2001
From: Andiry Xu <andiry.xu@xxxxxxxxx>
Date: Mon, 11 Jun 2012 16:51:21 +0800
Subject: [PATCH] xHCI: Increase the timeout for controller save/restore state operation

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/Restore
State flag in the USBCMD register and wait for the Save/Restore State
Status flag in the USBSTS register to transition to '0'". However, it does
not define how long software should wait for the SSS/RSS 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/restore 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 |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index afdc73e..73e8817 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -795,8 +795,8 @@ 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)) {
-		xhci_warn(xhci, "WARN: xHC CMD_CSS timeout\n");
+	if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10 * 1000)) {
+		xhci_warn(xhci, "WARN: xHC save state timeout\n");
 		spin_unlock_irq(&xhci->lock);
 		return -ETIMEDOUT;
 	}
@@ -848,8 +848,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 		command |= CMD_CRS;
 		xhci_writel(xhci, command, &xhci->op_regs->command);
 		if (handshake(xhci, &xhci->op_regs->status,
-			      STS_RESTORE, 0, 10*100)) {
-			xhci_dbg(xhci, "WARN: xHC CMD_CSS timeout\n");
+			      STS_RESTORE, 0, 10 * 1000)) {
+			xhci_warn(xhci, "WARN: xHC restore state timeout\n");
 			spin_unlock_irq(&xhci->lock);
 			return -ETIMEDOUT;
 		}
-- 
1.7.4.1


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux