On Fri, 25 Nov 2005, Benjamin Herrenschmidt wrote:

> On Mon, 2005-11-21 at 11:58 -0500, Alan Stern wrote:
> > Greg:
> > 
> > The earlier USB locking updates didn't touch the suspend/resume routines.  
> > They need updating as well, since now the caller holds the device
> > semaphore.  This patch (as608) makes the necessary changes.  It also adds
> > a line to store the correct power state when a device is resumed,
> > something which was unaccountably missing.
> 
> So you require usb_suspend_device() to be called with a PM/device core
> lock for your locking right ?

Yes.

> What is the right lock to take if, for example, I'm a driver that
> decides that my device will have nothing to do for a while and wants to
> suspend it to save power (dynamic local PM) ?

The infrastructure for dynamic local PM hasn't been created yet, so for 
now you can do pretty much whatever you like.  Not long ago David added a 
usb_suspend_root_hub routine to usbcore to help with such things; I don't 
know if you will want to use it.

The safest thing is to call dpm_runtime_suspend.  That will acquire the 
lock for you.

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
_______________________________________________
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