On Sat, 28 Oct 2006, Oliver Neukum wrote:

> > +static int usb_autopm_do_device(struct usb_device *udev, int inc_usage_cnt)
> > +{
> > +   int     status;
> > +
> > +   usb_pm_lock(udev);
> > +   udev->pm_usage_cnt += inc_usage_cnt;
> > +   if (udev->pm_usage_cnt > 0) {
> > +           udev->auto_pm = 1;
> > +           status = usb_resume_both(udev);
> > +           if (status != 0)
> > +                   udev->pm_usage_cnt -= inc_usage_cnt;
> 
> Is this a good idea? If I want to disable autopm I want to do so even
> if the device cannot be woken.

Actually this probably doesn't matter one way or the other.  If you can't 
wake up the device, being able to prevent autosuspend won't help.  And the 
most likely reason for the device not waking up is that it has been 
disconnected, in which case the autosuspend setting is moot.

My main reason for putting that line in was to try and keep the
pm_usage_cnt values in sync with the device's actual state.  If you can 
suggest a reasonable scenario where removing the statement would make 
something work better, I won't mind taking it out.

Alan Stern


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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