diff options
author | Oliver Neukum <oneukum@suse.com> | 2016-01-21 15:18:47 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-03 13:29:12 -0800 |
commit | 7dd9cba5bb90ffa9c60c1533b715dc91c5082cd9 (patch) | |
tree | bb4a3865a2873a13a642352bff604c951459e873 /include/linux/usb.h | |
parent | 5363de75307e333d89df7531f9dd8310d973ecdb (diff) | |
download | lwn-7dd9cba5bb90ffa9c60c1533b715dc91c5082cd9.tar.gz lwn-7dd9cba5bb90ffa9c60c1533b715dc91c5082cd9.zip |
usb: sysfs: make locking interruptible
232275a USB: fix substandard locking for the sysfs files
introduced needed locking into sysfs operations on USB devices
It, however, uses uninterruptible sleep and if the error
handling is on extreme cases of sleep lengths of 10s of seconds
are possible. Unless we are removing the device we should use
interruptible sleep.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r-- | include/linux/usb.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 0d348fa84a66..dc0ea0de8a81 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -641,9 +641,10 @@ extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, if (!child) continue; else /* USB device locking */ -#define usb_lock_device(udev) device_lock(&(udev)->dev) -#define usb_unlock_device(udev) device_unlock(&(udev)->dev) -#define usb_trylock_device(udev) device_trylock(&(udev)->dev) +#define usb_lock_device(udev) device_lock(&(udev)->dev) +#define usb_unlock_device(udev) device_unlock(&(udev)->dev) +#define usb_lock_device_interruptible(udev) device_lock_interruptible(&(udev)->dev) +#define usb_trylock_device(udev) device_trylock(&(udev)->dev) extern int usb_lock_device_for_reset(struct usb_device *udev, const struct usb_interface *iface); |