Re: usb_autopm_put_interface()

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

 



On Mon, 11 Jan 2010, Oliver Neukum wrote:

> Hi,
> 
> this made me wonder:
> 
> void usb_autopm_put_interface(struct usb_interface *intf)
> {
> 	struct usb_device	*udev = interface_to_usbdev(intf);
> 	int			status;
> 
> 	udev->last_busy = jiffies;
> 
> Why do we set last_busy here?

For one thing, the current implementation does so.

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.

Conversely, if the usage count still remains positive or if other
interfaces are still in use then setting last_busy doesn't cause any
harm.

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