diff options
author | Bernd Porr <berndporr@f2s.com> | 2009-11-27 07:00:53 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-23 14:27:45 -0500 |
commit | d4c3a56587af3edbe5f618b20e800e9f9fde13cb (patch) | |
tree | c5968064db803c106cc9486e00d795ac07c4ec9f /drivers | |
parent | 29d249ed80c80b479df78e456e6809223c648505 (diff) |
Staging: comedi: usbdux.c: fix locking up of the driver when the comedi ringbuffer runs empty
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/usbdux.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index 06c020466298..9a1b559c4b0d 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c | |||
@@ -1,4 +1,4 @@ | |||
1 | #define DRIVER_VERSION "v2.3" | 1 | #define DRIVER_VERSION "v2.4" |
2 | #define DRIVER_AUTHOR "Bernd Porr, BerndPorr@f2s.com" | 2 | #define DRIVER_AUTHOR "Bernd Porr, BerndPorr@f2s.com" |
3 | #define DRIVER_DESC "Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com" | 3 | #define DRIVER_DESC "Stirling/ITL USB-DUX -- Bernd.Porr@f2s.com" |
4 | /* | 4 | /* |
@@ -81,6 +81,8 @@ sampling rate. If you sample two channels you get 4kHz and so on. | |||
81 | * 2.1: changed PWM API | 81 | * 2.1: changed PWM API |
82 | * 2.2: added firmware kernel request to fix an udev problem | 82 | * 2.2: added firmware kernel request to fix an udev problem |
83 | * 2.3: corrected a bug in bulk timeouts which were far too short | 83 | * 2.3: corrected a bug in bulk timeouts which were far too short |
84 | * 2.4: fixed a bug which causes the driver to hang when it ran out of data. | ||
85 | * Thanks to Jan-Matthias Braun and Ian to spot the bug and fix it. | ||
84 | * | 86 | * |
85 | */ | 87 | */ |
86 | 88 | ||
@@ -532,6 +534,7 @@ static void usbduxsub_ai_IsocIrq(struct urb *urb) | |||
532 | } | 534 | } |
533 | } | 535 | } |
534 | /* tell comedi that data is there */ | 536 | /* tell comedi that data is there */ |
537 | s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS; | ||
535 | comedi_event(this_usbduxsub->comedidev, s); | 538 | comedi_event(this_usbduxsub->comedidev, s); |
536 | } | 539 | } |
537 | 540 | ||