Re: usb_autopm_put_interface()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 12 Jan 2010, Oliver Neukum wrote:

> Am Montag, 11. Januar 2010 20:37:18 schrieb Alan Stern:
> > More to the point, usb_autopm_put_interface() can cause the usage count
> > to drop to 0.  If the last_busy value was too far in the past, the
> > device would be autosuspended immediately.  That's not what we want;  
> > the autosuspend shouldn't occur until after the appropriate delay.  And 
> > the delay should begin at the time the device is no longer being used, 
> > which is the time when usb_autopm_put_interface() is called.
> 
> But is this the time the device is used for the last time?
> It seems to me that the last time a device is used is the last time
> IO is done to it. In most cases usb_autopm_put_interface() is called
> in close(), which can be a long time after IO was done for the last time.

What's wrong with that?  If the device has been prevented from 
autosuspending for "a long time", I don't see any problem with adding 
on a few extra seconds for the autosuspend delay to expire.

We can't depend on the driver to update last_busy when I/O actually
finishes, anyway.  Or do you think usb_hcd_giveback_urb() should update
udev->last_busy every time an URB completes with 0 status?

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux