[quoted lines by Alan Stern on 2007/06/18 at 10:25 -0400] >> Yes, except that the setting would be just for the close of the file >> descriptor. > >You mean sort of "remember the previous setting, store a 0, then when >the file is closed reinstate the old setting"? Sounds cumbersome and >prone to failure.
Now that I understand exactly how the .../power/autosuspend value is used, the feature I was imagining wouldn't be useful. >> Should we be querying the device via sysfs >> instead even though it means a lot more open/read/close system calls? > >Doing so would avoid the resume/suspend cycles. But I would say it's >not worth the effort to convert over, if that's your only reason. If >you were starting fresh with a new program then using sysfs would be >the best way to go. It's not all that many more open/read/close calls, >and they are completely internal to the kernel anyway so they run >extremely quickly. What about having another sysfs device file called "descriptor" which one could read and which would return the same data as an opened usbfs file? >It sounds like you don't understand exactly what the value in >power/autosuspend does. The number is an autosuspend delay, in >seconds. By default it is equal to 2, which means that the device >would be autosuspended 2 seconds after its usbfs file is closed or the >device is in some other way no longer being used. In 2.6.21 a value >of 0 means never autosuspend, but in 2.6.22 a 0 means autosuspend >immediately after the close and -1 means never autosuspend. > >So if you close the file and later write 2 to power/autosuspend, that >means the device will be autosuspended 2 seconds after the write >instead of 2 seconds after the close. You were right. I was close, but I didn't understand it well enough. Thanks. >This probably falls into the category of defeating yourself. :-) Indeed. :-) -- Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me EMail: [EMAIL PROTECTED] | Canada K2A 1H7 | if you're concerned about Hell. http://FamilyRadio.com/ | http://Mielke.cc/bible/ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Linux-usb-users@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users