linux/drivers/staging/comedi
Ian Abbott ef4b4b274c staging: comedi: comedi_fops: extend spin-lock scope in comedi_event()
`comedi_event()` is called from low-level drivers to handle comedi
asynchronous command event flags.  As a safety check, it checks the
subdevice's "run" flags to make sure an asynchronous command is running.
It can also change the run flags to mark the command as no longer
running (possibly also marking it as terminated with an error).
Checking the runflags and modifying them involves two uses of the
subdevice's spin-lock.  It seems better to do it with a single use of
the spin-lock.  This also avoids possible interactions with
`do_become_nonbusy()`.

Acquire the subdevice's spin-lock at the start of `comedi_event()` and
release it near the end, before a possible call to `kill_fasync()` (but
after it's parameter values have been determined).

Add and make use of few new inline helper functions:

* `__comedi_clear_subdevice_runflags()` -- clears some run flags without
  using the spin-lock
* `__comedi_set_subdevice_runflags()` -- sets some run flags without
  using the spin-lock
* `__comedi_get_subdevice_runflags()` -- a spin-lockless version of
  `comedi_get_subdevice_runflags()
* `__comedi_is_subdevice_running()` -- a spin-lockless version of
* `comedi_is_subdevice_running()`

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 13:11:54 +02:00
..
drivers Staging: comedi: addi_apci_1564: Delete a tap 2015-04-03 11:10:27 +02:00
kcomedilib staging: comedi: kcomedilib_main: (!foo) preferred over (foo == NULL) 2015-03-06 16:01:30 -08:00
comedi_buf.c staging: comedi: comedidev.h: add 'scans_done' member to comedi_async 2014-11-05 14:59:46 -08:00
comedi_compat32.c staging: comedi: comedi_compat32.c: absorb raw_ioctl() 2015-01-28 11:19:34 -08:00
comedi_compat32.h staging: comedi: comedi_compat32.h: reformat copyright comment 2015-01-28 11:19:34 -08:00
comedi_fops.c staging: comedi: comedi_fops: extend spin-lock scope in comedi_event() 2015-04-03 13:11:54 +02: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.c: include new "comedi_pci.h" header 2015-03-20 14:08:09 +01:00
comedi_pci.h staging: comedi: comedi_pci.h: move PCI stuff out of comedidev.h 2015-03-20 14:08:18 +01:00
comedi_pcmcia.c staging: comedi: comedi_pcmcia.c: include new "comedi_pcmcia.h" header 2015-02-07 17:05:50 +08:00
comedi_pcmcia.h staging: comedi: comedi_pcmcia.h: move PCMCIA stuff out of comedidev.h 2015-02-07 17:05:51 +08:00
comedi_usb.c staging: comedi: comedi_usb.c: include new "comedi_usb.h" header 2015-01-28 11:18:50 -08:00
comedi_usb.h staging: comedi: comedi_usb.h: move USB stuff out of comedidev.h 2015-01-28 11:18:51 -08:00
comedi.h staging: comedi: add ioctls to set per-file read and write subdevice 2014-11-05 14:52:18 -08:00
comedidev.h staging: comedi: comedi_pci.h: move PCI stuff out of comedidev.h 2015-03-20 14:08:18 +01:00
comedilib.h
drivers.c staging: comedi: drivers: (!foo) preferred over (foo == NULL) 2015-03-06 16:01:28 -08:00
Kconfig staging: comedi: cb_pcimdas: add 8254 timer (pacer) support 2015-03-01 18:56:31 -08:00
Makefile staging: comedi: split out PCI support into new module 2014-11-07 09:24:33 -08:00
proc.c
range.c staging: comedi: range.c: reformat copyright comment 2015-02-07 17:04:22 +08:00
TODO