Re: Wakeup settings for USB hubs?

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

 



On Wed, 2007-07-04 at 14:43 -0400, Alan Stern wrote:
> Here's a question that has been bothering me for a while.  Should we 
> enable remote wakeup on USB hubs?
> 
> On the face of it the answer is obviously Yes.  And certainly we want
> remote wakeup enabled during a runtime suspend; otherwise the system
> would never know when the user unplugged a device from the hub or
> plugged in a new one.
> 
> But consider STR, say in the case of a laptop with a USB mouse
> attached.  The user suspends the laptop.  Then he prepares to pack it
> away and in the process unplugs the mouse.  Pow! -- the laptop
> springs back to life.  That's not what we want.
> 
> On the other hand, the user might indeed want to awaken the laptop by
> clicking the USB mouse.  So what should we do?  The question is made
> even more difficult by the fact that, if the hub is already
> runtime-suspended when the system suspend occurs, we would have to
> resume the hub just in order to turn off remote wakeup!
> 
> Right now we more or less ignore all these issues by relying on the 
> wakeup settings in sysfs.  Is that a reasonable approach?  Is there 
> anything else we can do?
> 

IMO, device runtime wakeup and wakeup from a system sleep state are
different.
If we want to make use of the wakeup setting in sysfs, we can't simply
enable/disable /sys/.../power/wakeup.

Some different values like "device_runtime" and "system_sleep" are
needed to indicate the different remote wakeup state.
Take ACPI platform for example:
"disable":		disable remote wakeup.
"device_runtime":	device runtime wakeup is enabled, while device 
			can not wakeup the system from a sleep state.
			For ACPI platforms, that's disable the wakeup
			GPE of the device.
"system_sleep":		the ability of wakeup system from a sleep state
			is enabled. It needs to enable the device
			runtime wakeup ability first. and enable wakeup
			GPE as well for ACPI platforms.

All the platform specific operations can be done in the
platform_enable_wakeup hook.
All the remote wakeup state are set to device_runtime by default.
We can set the ../power/state to "system_sleep" when we want to wakeup
the system from STR by clicking the USB mouse. :)

Thanks,
Rui
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux