]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.32 comedi patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 19 Apr 2010 21:57:30 +0000 (14:57 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 19 Apr 2010 21:57:30 +0000 (14:57 -0700)
queue-2.6.32/series
queue-2.6.32/staging-comedi-fix-usbdux-timeout-bug.patch [new file with mode: 0644]
queue-2.6.32/staging-comedi-usbdux.c-fix-locking-up-of-the-driver-when-the-comedi-ringbuffer-runs-empty.patch [new file with mode: 0644]

index 7ed0555901458b31093e4e8e75afc5e759244c82..361f176488a8285af13bf945558555346b23f357 100644 (file)
@@ -125,3 +125,5 @@ x86-64-rwsem-avoid-store-forwarding-hazard-in-__downgrade_write.patch
 fix-nfs4-handling-of-mountpoint-stat.patch
 dm-mpath-fix-stall-when-requeueing-io.patch
 quota-fix-possible-dq_flags-corruption.patch
+staging-comedi-fix-usbdux-timeout-bug.patch
+staging-comedi-usbdux.c-fix-locking-up-of-the-driver-when-the-comedi-ringbuffer-runs-empty.patch
diff --git a/queue-2.6.32/staging-comedi-fix-usbdux-timeout-bug.patch b/queue-2.6.32/staging-comedi-fix-usbdux-timeout-bug.patch
new file mode 100644 (file)
index 0000000..73ed457
--- /dev/null
@@ -0,0 +1,94 @@
+From ea25371a78c33e276527361d3ab19393d558b2fd Mon Sep 17 00:00:00 2001
+From: Bernd Porr <BerndPorr@f2s.com>
+Date: Mon, 16 Nov 2009 01:12:02 +0000
+Subject: Staging: comedi: fix usbdux timeout bug
+
+From: Bernd Porr <BerndPorr@f2s.com>
+
+commit ea25371a78c33e276527361d3ab19393d558b2fd upstream.
+
+I've fixed a bug in the USBDUX driver which caused timeouts while
+sending commands to the boards. This was mainly because of one bulk
+transfer which had a timeout of 1ms (!). I've now set all timeouts to
+1000ms.
+
+From: Bernd Porr <BerndPorr@f2s.com>
+Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/comedi/drivers/usbdux.c |   17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+--- a/drivers/staging/comedi/drivers/usbdux.c
++++ b/drivers/staging/comedi/drivers/usbdux.c
+@@ -1,4 +1,4 @@
+-#define DRIVER_VERSION "v2.2"
++#define DRIVER_VERSION "v2.3"
+ #define DRIVER_AUTHOR "Bernd Porr, BerndPorr@f2s.com"
+ #define DRIVER_DESC "Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com"
+ /*
+@@ -80,6 +80,7 @@ sampling rate. If you sample two channel
+  * 2.0:  PWM seems to be stable and is not interfering with the other functions
+  * 2.1:  changed PWM API
+  * 2.2:  added firmware kernel request to fix an udev problem
++ * 2.3:  corrected a bug in bulk timeouts which were far too short
+  *
+  */
+@@ -101,8 +102,8 @@ sampling rate. If you sample two channel
+ #define BOARDNAME "usbdux"
+-/* timeout for the USB-transfer */
+-#define EZTIMEOUT 30
++/* timeout for the USB-transfer in ms*/
++#define BULK_TIMEOUT 1000
+ /* constants for "firmware" upload and download */
+ #define USBDUXSUB_FIRMWARE 0xA0
+@@ -750,7 +751,7 @@ static int usbduxsub_start(struct usbdux
+                                 /* Length */
+                                 1,
+                                 /* Timeout */
+-                                EZTIMEOUT);
++                                BULK_TIMEOUT);
+       if (errcode < 0) {
+               dev_err(&usbduxsub->interface->dev,
+                       "comedi_: control msg failed (start)\n");
+@@ -780,7 +781,7 @@ static int usbduxsub_stop(struct usbduxs
+                                 /* Length */
+                                 1,
+                                 /* Timeout */
+-                                EZTIMEOUT);
++                                BULK_TIMEOUT);
+       if (errcode < 0) {
+               dev_err(&usbduxsub->interface->dev,
+                       "comedi_: control msg failed (stop)\n");
+@@ -810,7 +811,7 @@ static int usbduxsub_upload(struct usbdu
+                                 /* length */
+                                 len,
+                                 /* timeout */
+-                                EZTIMEOUT);
++                                BULK_TIMEOUT);
+       dev_dbg(&usbduxsub->interface->dev, "comedi_: result=%d\n", errcode);
+       if (errcode < 0) {
+               dev_err(&usbduxsub->interface->dev, "comedi_: upload failed\n");
+@@ -1110,7 +1111,7 @@ static int send_dux_commands(struct usbd
+                             usb_sndbulkpipe(this_usbduxsub->usbdev,
+                                             COMMAND_OUT_EP),
+                             this_usbduxsub->dux_commands, SIZEOFDUXBUFFER,
+-                            &nsent, 10);
++                            &nsent, BULK_TIMEOUT);
+       if (result < 0)
+               dev_err(&this_usbduxsub->interface->dev, "comedi%d: "
+                       "could not transmit dux_command to the usb-device, "
+@@ -1130,7 +1131,7 @@ static int receive_dux_commands(struct u
+                                     usb_rcvbulkpipe(this_usbduxsub->usbdev,
+                                                     COMMAND_IN_EP),
+                                     this_usbduxsub->insnBuffer, SIZEINSNBUF,
+-                                    &nrec, 1);
++                                    &nrec, BULK_TIMEOUT);
+               if (result < 0) {
+                       dev_err(&this_usbduxsub->interface->dev, "comedi%d: "
+                               "insn: USB error %d while receiving DUX command"
diff --git a/queue-2.6.32/staging-comedi-usbdux.c-fix-locking-up-of-the-driver-when-the-comedi-ringbuffer-runs-empty.patch b/queue-2.6.32/staging-comedi-usbdux.c-fix-locking-up-of-the-driver-when-the-comedi-ringbuffer-runs-empty.patch
new file mode 100644 (file)
index 0000000..46b8a23
--- /dev/null
@@ -0,0 +1,48 @@
+From d4c3a56587af3edbe5f618b20e800e9f9fde13cb Mon Sep 17 00:00:00 2001
+From: Bernd Porr <berndporr@f2s.com>
+Date: Fri, 27 Nov 2009 12:00:53 +0000
+Subject: Staging: comedi: usbdux.c: fix locking up of the driver when the comedi ringbuffer runs empty
+
+From: Bernd Porr <berndporr@f2s.com>
+
+commit d4c3a56587af3edbe5f618b20e800e9f9fde13cb upstream.
+
+Jan-Matthias Braun spotted a bug which locks up the driver when the
+comedi ring buffer runs empty and provided a patch. The driver would
+still send the data to comedi but the reader won't wake up any more.
+What's required is setting the flag COMEDI_CB_BLOCK after new data has
+arrived which wakes up the reader and therefore the read() command.
+
+Signed-off-by: Bernd Porr <berndporr@f2s.com>
+Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/staging/comedi/drivers/usbdux.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/comedi/drivers/usbdux.c
++++ b/drivers/staging/comedi/drivers/usbdux.c
+@@ -1,4 +1,4 @@
+-#define DRIVER_VERSION "v2.3"
++#define DRIVER_VERSION "v2.4"
+ #define DRIVER_AUTHOR "Bernd Porr, BerndPorr@f2s.com"
+ #define DRIVER_DESC "Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com"
+ /*
+@@ -81,6 +81,8 @@ sampling rate. If you sample two channel
+  * 2.1:  changed PWM API
+  * 2.2:  added firmware kernel request to fix an udev problem
+  * 2.3:  corrected a bug in bulk timeouts which were far too short
++ * 2.4:  fixed a bug which causes the driver to hang when it ran out of data.
++ *       Thanks to Jan-Matthias Braun and Ian to spot the bug and fix it.
+  *
+  */
+@@ -532,6 +534,7 @@ static void usbduxsub_ai_IsocIrq(struct
+               }
+       }
+       /* tell comedi that data is there */
++      s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
+       comedi_event(this_usbduxsub->comedidev, s);
+ }