]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
46b8a23b45790ff9b1adce581d3d1f3f0ff4e23b
[thirdparty/kernel/stable-queue.git] /
1 From d4c3a56587af3edbe5f618b20e800e9f9fde13cb Mon Sep 17 00:00:00 2001
2 From: Bernd Porr <berndporr@f2s.com>
3 Date: Fri, 27 Nov 2009 12:00:53 +0000
4 Subject: Staging: comedi: usbdux.c: fix locking up of the driver when the comedi ringbuffer runs empty
5
6 From: Bernd Porr <berndporr@f2s.com>
7
8 commit d4c3a56587af3edbe5f618b20e800e9f9fde13cb upstream.
9
10 Jan-Matthias Braun spotted a bug which locks up the driver when the
11 comedi ring buffer runs empty and provided a patch. The driver would
12 still send the data to comedi but the reader won't wake up any more.
13 What's required is setting the flag COMEDI_CB_BLOCK after new data has
14 arrived which wakes up the reader and therefore the read() command.
15
16 Signed-off-by: Bernd Porr <berndporr@f2s.com>
17 Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
19
20 ---
21 drivers/staging/comedi/drivers/usbdux.c | 5 ++++-
22 1 file changed, 4 insertions(+), 1 deletion(-)
23
24 --- a/drivers/staging/comedi/drivers/usbdux.c
25 +++ b/drivers/staging/comedi/drivers/usbdux.c
26 @@ -1,4 +1,4 @@
27 -#define DRIVER_VERSION "v2.3"
28 +#define DRIVER_VERSION "v2.4"
29 #define DRIVER_AUTHOR "Bernd Porr, BerndPorr@f2s.com"
30 #define DRIVER_DESC "Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com"
31 /*
32 @@ -81,6 +81,8 @@ sampling rate. If you sample two channel
33 * 2.1: changed PWM API
34 * 2.2: added firmware kernel request to fix an udev problem
35 * 2.3: corrected a bug in bulk timeouts which were far too short
36 + * 2.4: fixed a bug which causes the driver to hang when it ran out of data.
37 + * Thanks to Jan-Matthias Braun and Ian to spot the bug and fix it.
38 *
39 */
40
41 @@ -532,6 +534,7 @@ static void usbduxsub_ai_IsocIrq(struct
42 }
43 }
44 /* tell comedi that data is there */
45 + s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
46 comedi_event(this_usbduxsub->comedidev, s);
47 }
48