linux/drivers/staging/comedi
Ian Abbott 0a43f75ef5 staging: comedi: das16: use spin-lock when setting timer
"das16" sets a timer running in `das16_cmd_exec()` and sets
`devpriv->timer_running` to indicate that it is running.  The timer
expiration routine `das16_timer_interrupt()` checks
`devpriv->timer_running` to check whether it needs to reschedule the
timer, but this is not synchronized with `das16_cmd_exec()`.  Since
`das16_cancel()` acquires the `dev->spinlock` spin-lock when clearing
`devpriv->timer_running` and removing the timer from the queue, use the
same spin-lock in `das16_cmd_exec()` and `das16_timer_interrupt()`
around the setting and checking of `devpriv->timer_running`.

Since `das16_interrupt()` (called from `das16_timer_interrupt()`) checks
whether DMA is enabled in the device while holding `dev->spinlock`, and
DMA is enabled by `das16_cmd_exec()` around the time it schedules the
timer, enable the DMA in the device while holding the spin-lock.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:29:31 -07:00
..
drivers staging: comedi: das16: use spin-lock when setting timer 2014-10-30 13:29:31 -07:00
kcomedilib Staging: comedi: kcomedilib: replace deprecated simple_strtoul() with kstrtouint() 2014-02-15 12:42:41 -08:00
Kconfig staging: comedi: addi_apci_035: remove driver 2014-10-29 15:56:53 +08:00
Makefile
TODO staging: comedi: TODO: remove item "reserve major number" 2014-05-28 14:18:11 -07:00
comedi.h staging: comedi: comedidev.h: don't expose COMEDI_CB_* defines to userspace 2014-10-29 15:47:11 +08:00
comedi_buf.c staging: comedi: comedi_buf: absorb __comedi_buf_write_alloc() 2014-10-29 16:03:16 +08:00
comedi_compat32.c staging: comedi: comedi_compat32: checkpatch.pl --strict cleanup 2014-07-18 16:10:39 -07:00
comedi_compat32.h staging: comedi: comedi_compat32.h: checkpatch.pl --strict cleanup 2014-07-18 16:10:40 -07:00
comedi_fops.c staging: comedi: comedidev.h: clarify async->event error/cancel detection 2014-10-29 15:47:11 +08:00
comedi_internal.h staging: comedi: comedi_internal.h: checkpatch.pl --strict cleanup 2014-07-18 16:10:39 -07:00
comedi_pci.c staging: comedi: comedi_pci: introduce comedi_pci_detach() 2014-08-30 13:24:54 -07:00
comedi_pcmcia.c
comedi_usb.c
comedidev.h staging: comedi: introduce some sample size manipulation functions 2014-10-29 16:12:41 +08:00
comedilib.h
drivers.c staging: comedi: comedidev.h: clarify async->event error/cancel detection 2014-10-29 15:47:11 +08:00
proc.c Staging: comedi: proc: title block update 2014-03-19 04:41:04 +00:00
range.c staging: comedi: Remove unecessary function and it's call 2014-10-20 10:29:13 +08:00