usb: yurex: make waiting on yurex_write interruptible
Subsystems (2)
PATCH v2 1/1 usb: yurex: make waiting on yurex_write interruptible
The IO yurex_write() needs to wait for in order to have a device ready for writing again can take a long time time. Consequently the sleep is done in an interruptible state. Therefore others waiting for yurex_write() itself to finish should use mutex_lock_interruptible.
---
v2: fix uninitialized variable
drivers/usb/misc/iowarrior.c | 4 ---- drivers/usb/misc/yurex.c | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/usb/misc/iowarrior.c +0 -4
@@ -892,7 +892,6 @@ static int iowarrior_probe(struct usb_interface *interface,static void iowarrior_disconnect (struct usb_interface *interface) {struct iowarrior *dev =usb_get_intfdata (interface); -int minor = dev->minor;usb_deregister_dev (interface, &iowarrior_class);
@@ -916,9 +915,6 @@ static void iowarrior_disconnect(struct usb_interface *interface)mutex_unlock (&dev->mutex);iowarrior_delete (dev); } - -dev_info (&interface->dev,"I/O-Warror #%d now disconnected\n" , - minor -IOWARRIOR_MINOR_BASE ); }/* usb specific object needed to register this driver with the usb subsystem */
drivers/usb/misc/yurex.c +4 -1
@@ -444,7 +444,10 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer,if (count ==0 ) goto error; -mutex_lock (&dev->io_mutex); + retval =mutex_lock_interruptible (&dev->io_mutex); +if (retval <0 ) +return -EINTR ; +if (dev->disconnected) {/* already disconnected */ mutex_unlock (&dev->io_mutex); retval = -ENODEV ;
Signature · 1 line
2.46.1
kernel test robot
build botFYI: kernel test robot notices the stable kernel rule is not satisfied.
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: [email protected]" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCHv2] usb: yurex: make waiting on yurex_write interruptible
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki