On Fri, Feb 23, 2007 at 06:44:27PM -0500, Alan Stern wrote: > 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.
Sure, but as the default is 2 seconds, it's hard to change that by hand. And, if you realize that the device was disabled, you can't turn it back on after the fact. > 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 yeah, that file isn't even in my builds anymore :( > (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. Oh, that's a fun hack, yeah, that worked... But try to document that one in a simple way. I still think that once we write to the autosuspend file, the timer should start over, with power enabled. If this means turning it back on, we should. Otherwise, it's very confusing. thanks, greg k-h ------------------------------------------------------------------------- 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