Re: [PATCH 2/8] USB: change locking for device-level autosuspend

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

 



Am Montag, 11. Januar 2010 20:32:14 schrieb Alan Stern:

> I still don't understand.  First, why would usb_autosuspend_device(),
> usb_autoresume_device(), or usb_try_autosuspend_device() do
> copy_from_user()?  As a general rule, they don't have a meaningful user
> context.  Second, why would the driver need to take the device lock?

I don't know, but quoting you (Documentation/usb/power-management.txt):

If a driver wants to block all suspend/resume calls during some
critical section, the best way is to lock the device and call
usb_autopm_get_interface() (and do the reverse at the end of the
critical section).  Holding the device semaphore will block all
external PM calls, and the usb_autopm_get_interface() will prevent any
internal PM calls, even if it fails.  (Exercise: Why?)

	Regards
		Oliver
--
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