linux/drivers/staging
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
..
android staging: android: sync: Fix memory corruption in sync_timeline_signal(). 2015-03-26 10:58:51 +01:00
board
clocking-wizard
comedi staging: comedi: comedi_fops: extend spin-lock scope in comedi_event() 2015-04-03 13:11:54 +02:00
dgap Staging: dgap: Use setup_timer to combine initialization 2015-03-16 16:17:31 +01:00
dgnc staging: dgnc_sysfs: Replace printk(KERN_ERR ) with pr_err() 2015-04-01 17:37:57 +02:00
emxx_udc Staging: emuxx_udc: replace pr_* with dev_* 2015-03-16 16:28:31 +01:00
fbtft staging: fbtft: Fix typo in fbtft 2015-03-26 13:07:29 +01:00
fsl-mc staging: fsl-mc: Corrected email addresses in TODO file 2015-03-20 14:11:29 +01:00
ft1000 ft1000-pcmcia: ft1000_hw.c: code refactoring: add ft1000_read_dsp_timer() 2015-03-26 11:07:41 +01:00
fwserial staging: fwserial: remove extra parentheses around function arguments 2015-03-15 18:41:11 +01:00
gdm72xx Staging: gdm72xx: use !x instead of x == NULL 2015-03-16 16:28:47 +01:00
gdm724x Staging: gdm724x: replace pr_* with dev_* 2015-03-18 11:21:33 +01:00
goldfish staging/goldfish/goldfish_audio: Fix annotations 2015-03-20 14:13:17 +01:00
gs_fpgaboot staging: Remove <linux/moduleparam.h> header. 2015-03-01 17:09:52 -08:00
i2o Staging: i2o: Remove indentation of labels 2015-03-26 10:40:31 +01:00
iio Staging: iio: accel: Remove explicit NULL comparison 2015-04-01 17:23:21 +02:00
lustre Merge lustre patches based on 4.0-rc5 into staging-testing 2015-04-03 12:56:21 +02:00
media Staging: media: remove useless dev_info to avoid null ptr dereference 2015-03-23 22:42:40 +01:00
mt29f_spinand staging: mt29f_spinand: remove pointer to pointer cast in function argument 2015-03-15 18:41:11 +01:00
netlogic staging: netlogic: allocate right size in devm_kzalloc 2015-03-20 14:13:17 +01:00
nvec Staging: nvec: use !x instead of x == NULL 2015-03-16 16:28:47 +01:00
octeon Staging: octeon: Remove extern from .c file 2015-03-26 10:40:32 +01:00
octeon-usb stating: octeon-usb: cvmx_usb_initialize(): eliminate extra indentation 2015-03-24 13:47:13 +01:00
olpc_dcon
ozwpan staging: ozwpan: implement error handling in ozwpan_init() 2015-03-26 13:13:13 +01:00
panel staging: panel: fix lcd type 2015-03-26 11:00:22 +01:00
rtl8188eu Staging: rtl8188eu: replace kzalloc and memcpy by kmemdup 2015-03-26 13:16:19 +01:00
rtl8192e staging: rtl8192e: remove CURRENT_RATE macro 2015-03-20 13:14:00 +01:00
rtl8192u Staging: rtl8192 Clean up function definition 2015-03-26 13:13:13 +01:00
rtl8712 Staging: rtl8712: Remove zero-testing pointer typed value 2015-04-01 17:26:58 +02:00
rtl8723au staging: rtl8723au: Update RT_TRACE macro and uses 2015-03-26 13:15:07 +01:00
rts5208 staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macros 2015-03-26 13:17:05 +01:00
skein Staging: skein: Remove do-while(0) from single statement macros 2015-03-15 18:41:15 +01:00
slicoss Staging: slicoss: Remove redundant and disabled code block 2015-03-27 00:02:52 +01:00
sm7xxfb staging: sm7xxfb: add MODULE_DEVICE_TABLE 2015-03-26 13:02:28 +01:00
sm750fb Staging: sm750fb: Remove zero testing pointer typed value 2015-04-03 11:10:27 +02:00
speakup Staging: speakup: Use module_spk_synth 2015-03-20 13:27:34 +01:00
ste_rmi4 Staging: ste_rmi4: Use SIMPLE_DEV_PM_OPS() macro 2015-03-20 13:37:31 +01:00
unisys staging: unisys: remove comparison 2015-03-27 00:01:24 +01:00
vme staging: vme: mmap() support for vme_user 2015-03-06 17:03:22 -08:00
vt6655 Merge 4.0-rc5 into staging-testing 2015-03-23 21:36:48 +01:00
vt6656 Merge 4.0-rc5 into staging-testing 2015-03-23 21:36:48 +01:00
wlan-ng Staging: wlan-ng: Remove typedef prism2sta_accesslist_t 2015-03-23 22:41:16 +01:00
xgifb staging: xgifb: remove extra parentheses around right bit shift operations 2015-03-06 15:22:43 -08:00
Kconfig staging: fsl-mc: Freescale Management Complex (fsl-mc) bus driver 2015-03-06 17:28:09 -08:00
Makefile staging: fsl-mc: Freescale Management Complex (fsl-mc) bus driver 2015-03-06 17:28:09 -08:00
staging.c