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
6 From: Bernd Porr <berndporr@f2s.com>
8 commit d4c3a56587af3edbe5f618b20e800e9f9fde13cb upstream.
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.
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>
21 drivers/staging/comedi/drivers/usbdux.c | 5 ++++-
22 1 file changed, 4 insertions(+), 1 deletion(-)
24 --- a/drivers/staging/comedi/drivers/usbdux.c
25 +++ b/drivers/staging/comedi/drivers/usbdux.c
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"
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.
41 @@ -532,6 +534,7 @@ static void usbduxsub_ai_IsocIrq(struct
44 /* tell comedi that data is there */
45 + s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
46 comedi_event(this_usbduxsub->comedidev, s);