On Wed, 28 Dec 2005, Dmitry Torokhov wrote:

> Hi,
> 
> I have a question regarding PM and USB input devices. Most if them do
> usb_submit_urb() from their ->open() routine and usb_kill_urb() from
> their ->suspend(). This all works quite well for system-wide PM event
> when userspace is frozen and there is noone to call ->open(). So what
> about run-time power management. What kind of locking would USB need?
> Will ->open() routine need to resume device somehow? Fail if device
> suspended?

I don't think there is any precedent for this sort of policy decision in 
Linux.  So now's your chance to affect the future course of kernel 
development!  :-)

There are three obvious possible choices:

     1. open() of a suspended device fails;

     2. open() of a suspended device succeeds but actual input operations
        fail or block;

     3. open() of a suspended device automatically resumes the device.

1 doesn't sound right.  If the device is already open, you don't fail a 
suspend call.  So why should you fail an open call just because the device 
is suspended?  If you really do want the effect of 1, the correct way to 
do it is to unbind the driver from the device.

Both 2 and 3 are workable.  At the moment I don't have any strong feelings
as to which is better.  It's possible that the locking needed to implement
3 will be difficult, but I haven't thought over the matter so I'm not 
sure.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to