]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 28 Jun 2014 15:37:35 +0000 (11:37 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 28 Jun 2014 15:37:35 +0000 (11:37 -0400)
added patches:
usb-usbtest-add-timetout-to-simple_io.patch

queue-3.4/series
queue-3.4/usb-usbtest-add-timetout-to-simple_io.patch [new file with mode: 0644]

index f117b44eaf3732c38198a4aabfa8ed7a3247fd2e..f1e6e788962a9b71464492a8ea05a3b12a5b200e 100644 (file)
@@ -39,3 +39,4 @@ btrfs-fix-double-free-in-find_lock_delalloc_range.patch
 fs-btrfs-volumes.c-fix-for-possible-null-pointer-dereference.patch
 btrfs-use-right-type-to-get-real-comparison.patch
 btrfs-fix-use-of-uninit-ret-in-end_extent_writepage.patch
+usb-usbtest-add-timetout-to-simple_io.patch
diff --git a/queue-3.4/usb-usbtest-add-timetout-to-simple_io.patch b/queue-3.4/usb-usbtest-add-timetout-to-simple_io.patch
new file mode 100644 (file)
index 0000000..6df9ec5
--- /dev/null
@@ -0,0 +1,56 @@
+From e5e4746510d140261918aecce2e5e3aa4456f7e9 Mon Sep 17 00:00:00 2001
+From: Roger Quadros <rogerq@ti.com>
+Date: Wed, 18 Dec 2013 15:40:10 +0530
+Subject: usb: usbtest: Add timetout to simple_io()
+
+From: Roger Quadros <rogerq@ti.com>
+
+commit e5e4746510d140261918aecce2e5e3aa4456f7e9 upstream.
+
+Without a timetout some tests e.g. test_halt() can remain stuck forever.
+
+Signed-off-by: Roger Quadros <rogerq@ti.com>
+Reviewed-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/misc/usbtest.c |   14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/misc/usbtest.c
++++ b/drivers/usb/misc/usbtest.c
+@@ -10,6 +10,7 @@
+ #include <linux/timer.h>
+ #include <linux/usb.h>
++#define SIMPLE_IO_TIMEOUT     10000   /* in milliseconds */
+ /*-------------------------------------------------------------------------*/
+@@ -355,6 +356,7 @@ static int simple_io(
+       int                     max = urb->transfer_buffer_length;
+       struct completion       completion;
+       int                     retval = 0;
++      unsigned long           expire;
+       urb->context = &completion;
+       while (retval == 0 && iterations-- > 0) {
+@@ -367,9 +369,15 @@ static int simple_io(
+               if (retval != 0)
+                       break;
+-              /* NOTE:  no timeouts; can't be broken out of by interrupt */
+-              wait_for_completion(&completion);
+-              retval = urb->status;
++              expire = msecs_to_jiffies(SIMPLE_IO_TIMEOUT);
++              if (!wait_for_completion_timeout(&completion, expire)) {
++                      usb_kill_urb(urb);
++                      retval = (urb->status == -ENOENT ?
++                                -ETIMEDOUT : urb->status);
++              } else {
++                      retval = urb->status;
++              }
++
+               urb->dev = udev;
+               if (retval == 0 && usb_pipein(urb->pipe))
+                       retval = simple_check_buf(tdev, urb);