Re: Question about USB keyboard remote wakeup from hibernation

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

 



On Wed, 13 Apr 2011, Andiry Xu wrote:

> Thanks for the elaborate explanation, that's really helpful.

Part of the discussion was wrong; I mixed up xhci_bus_suspend and 
xhci_pci_suspend.  But it looks like you realized what I meant.

> I've not got a serial console but I managed to catch some call trace
> using a very simple but effective method: use outb(data, 0x80) and check
> the LED display on the motherboard.
> 
> xhci_bus_suspend() will check all the ports and suspend them if they are
> in U0 state. this makes things different for suspend and hibernation.
> 
> During system suspend, the call trace is like this:
> usb_port_suspend():
>     Set REMOTE_WAKEUP request to the device;
>     Suspend the port;
> xhci_bus_suspend():
>     //The port is already suspended
> xhci_pci_suspend()
>     Suspend the host;
> 
> During system hibernation, the call trace is like this:
> xhci_bus_suspend():
>     Suspend the port, since it's in U0 state;

There should be a call to xhci_bus_resume() at this point, during the
second or "thaw" stage.  It should put the port back into U0.

> usb_port_suspend():
>     No REMOTE_WAKEUP request is sent to the device, maybe because it's
> suspended?

The remote-wakeup request should have been sent because the port should
not have been suspended.

>     Suspend the port;
> xhci_pci_suspend():
>     Suspend the host;
> 
> So remote wakeup is not working.
> 
> I made a small test, skip the port suspend part in xhci_bus_suspend():
> xhci_bus_suspend():
>     //Skip the port suspend part;

See if you can trace the call to xhci_bus_resume() that's supposed to
appear here.

> usb_port_suspend():
>     REMOTE_WAKEUP request is sent to the device;
>     Suspend the port;
> xhci_pci_suspend():
>     Suspend the host;
> 
> And by doing this, press the USB keyboard on xHCI can wakeup the system
> from hibernation.
> 
> The xhci bus suspend/resume is mainly copied from EHCI bus
> suspend/resume method, in which EHCI suspend all the ports during bus
> suspend. Seems it should be modified for xHCI. Any suggestions?

The same scheme should work for both EHCI and xHCI.  I can't tell what
the problem is.

Alan Stern

--
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


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

  Powered by Linux