mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 13:11:14 +00:00
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>
This commit is contained in:
parent
5363de7530
commit
7dd9cba5bb
3 changed files with 58 additions and 23 deletions
|
@ -958,6 +958,11 @@ static inline void device_lock(struct device *dev)
|
|||
mutex_lock(&dev->mutex);
|
||||
}
|
||||
|
||||
static inline int device_lock_interruptible(struct device *dev)
|
||||
{
|
||||
return mutex_lock_interruptible(&dev->mutex);
|
||||
}
|
||||
|
||||
static inline int device_trylock(struct device *dev)
|
||||
{
|
||||
return mutex_trylock(&dev->mutex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue