On Fri, 23 Feb 2007, Greg KH wrote:

> On Tue, Feb 20, 2007 at 03:03:32PM -0500, Alan Stern wrote:
> > This patch (as861) adds sysfs attributes to expose the autosuspend
> > delay value for each USB device.  If the user changes the delay from 0
> > (no autosuspend) to a positive value, an autosuspend is attempted.
> 
> But if a user changes the value to 0, the device is not woken back up.
> 
> Is this ok?  I think we should be able to turn power back on to a device
> if we want to.

Hah!  Oliver and I had exactly this same discussion a week or two ago.

The gist of it runs like this: The autosuspend attribute file controls
when & whether autosuspend events will occur.  If you set it to 0 then
there will be no more autosuspend events.  Devices that are awake will
remain awake and devices that are asleep will remain asleep.  Or to put it
another way, lack of any more autosuspend events != presence of an
autoresume event.

Besides, people already do have several ways of turning power back on to a 
device.  If you are the superuser you can do

        echo -n 0 >/sys/bus/usb/devices/.../power/state

(although this is deprecated and will vanish in July -- we may want to add
a new attribute file just for USB devices so that people won't lose the
ability to do selective suspends and resumes).  Even if you are just a
normal user, opening a device's usbfs file will resume that device.  And
running any program based on libusb -- such as lsusb -- will wake up all
suspended USB devices.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to