linux/drivers/media/video
Jonathan Nieder 8a317a8760 [media] cx88: protect per-device driver list with device lock
The BKL conversion of this driver seems to have gone wrong.  Various
uses of the sub-device and driver lists appear to be subject to race
conditions.

In particular, some functions access drvlist without a relevant lock
held, which will race against removal of drivers.  Let's start with
that --- clean up by consistently protecting dev->drvlist with
dev->core->lock, noting driver functions that require the device lock
to be held or not to be held.

After this patch, there are still some races --- e.g.,
cx8802_blackbird_remove can run between the time the blackbird driver
is acquired and the time it is used in mpeg_release, and there's a
similar race in cx88_dvb_bus_ctrl.  Later patches will address the
remaining known races and the deadlock noticed by Andi.  This patch
just makes the semantics clearer in preparation for those later
changes.

Based on work by Ben Hutchings <ben@decadent.org.uk>.

Tested-by: Andi Huber <hobrom@gmx.at>
Tested-by: Marlon de Boer <marlon@hyves.nl>
Cc: stable@kernel.org
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-05-20 09:29:34 -03:00
..
au0828 Fix common misspellings 2011-03-31 11:26:23 -03:00
bt8xx [media] use pci_dev->revision 2011-05-20 07:26:16 -03:00
cpia2 [media] v4l2-ioctl: add priority handling support 2011-03-22 16:37:59 -03:00
cx18 [media] cx18: mmap() support for raw YUV video capture 2011-05-20 09:28:43 -03:00
cx88 [media] cx88: protect per-device driver list with device lock 2011-05-20 09:29:34 -03:00
cx231xx [media] cx231xx: add support for Kworld 2011-05-20 09:28:49 -03:00
cx23885 [media] cx23885: Don't leak firmware in cx23885_card_setup() 2011-05-20 09:28:47 -03:00
cx25840 Fix common misspellings 2011-03-31 11:26:23 -03:00
davinci Fix common misspellings 2011-03-31 11:26:23 -03:00
em28xx [media] em28xx: add remote control support for PCTV 330e 2011-05-20 07:26:23 -03:00
et61x251 [media] et61x251: remove wrongly claimed usb ids 2011-01-19 11:45:01 -02:00
gspca [media] gspca - kinect: New subdriver for Microsoft Kinect 2011-05-20 09:27:27 -03:00
hdpvr [media] hdpvr: use same polling interval as other OS 2011-03-22 19:24:19 -03:00
ivtv [media] use pci_dev->revision 2011-05-20 07:26:16 -03:00
omap Fix common misspellings 2011-03-31 11:26:23 -03:00
omap3isp Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-04-27 15:17:52 -07:00
pvrusb2 [media] pvrusb2: delete generic_standards_cnt 2011-05-20 09:28:25 -03:00
pwc [media] pwc: Handle V4L2_CTRL_FLAG_NEXT_CTRL in queryctrl 2011-05-20 09:28:27 -03:00
s5p-fimc Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-04-27 15:17:52 -07:00
saa7134 [media] saa7134: support MagicPro ProHDTV Pro2 Hybrid DMB-TH PCI card 2011-05-20 09:28:22 -03:00
saa7164 [media] use pci_dev->revision 2011-05-20 07:26:16 -03:00
sn9c102 Fix common misspellings 2011-03-31 11:26:23 -03:00
tlg2300 [media] drivers/media/video/tlg2300/pd-video.c: Remove second mutex_unlock in pd_vidioc_s_fmt 2011-03-22 06:51:57 -03:00
usbvision [media] usbvision: remove broken testpattern 2011-05-20 09:29:31 -03:00
uvc Fix common misspellings 2011-03-31 11:26:23 -03:00
zoran [media] zoran: Drop unused module parameters encoder and decoder 2011-05-20 09:28:21 -03:00
adv7170.c V4L/DVB: adv7170: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:06:04 -02:00
adv7175.c [media] adv7175: support s_power 2011-01-19 11:45:55 -02:00
adv7180.c V4L/DVB: v4l: remove unused i2c-id.h headers 2010-10-21 01:06:05 -02:00
adv7343_regs.h [media] adv7343: use control framework 2011-03-21 20:31:49 -03:00
adv7343.c [media] adv7343: use control framework 2011-03-21 20:31:49 -03:00
ak881x.c
arv.c [media] BKL: trivial ioctl -> unlocked_ioctl video driver conversions 2010-12-01 20:10:10 -02:00
bt819.c [media] bt819: use control framework 2011-03-21 20:31:49 -03:00
bt856.c V4L/DVB: bt856: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:06:02 -02:00
bt866.c V4L/DVB: bt866: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:06:00 -02:00
btcx-risc.c
btcx-risc.h
bw-qcam.c [media] BKL: trivial ioctl -> unlocked_ioctl video driver conversions 2010-12-01 20:10:10 -02:00
c-qcam.c [media] BKL: trivial ioctl -> unlocked_ioctl video driver conversions 2010-12-01 20:10:10 -02:00
cafe_ccic-regs.h
cafe_ccic.c Fix common misspellings 2011-03-31 11:26:23 -03:00
cs53l32a.c V4L/DVB: cs53l32a: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:06:03 -02:00
cs5345.c [media] cs5345: use the control framework 2011-03-21 20:31:49 -03:00
cs8420.h
cx2341x.c [media] v4l2-ctrls: use const char * const * for the menu arrays 2010-12-30 08:02:14 -02:00
fsl-viu.c dt: Eliminate of_platform_{,un}register_driver 2011-02-28 13:22:46 -07:00
hexium_gemini.c Fix common misspellings 2011-03-31 11:26:23 -03:00
hexium_orion.c [media] v4l: fix handling of v4l2_input.capabilities 2010-12-30 08:02:29 -02:00
ibmmpeg2.h
imx074.c [media] imx074: return a meaningful error code instead of -1 2011-04-13 09:54:35 -03:00
indycam.c V4L/DVB: indycam: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:05:59 -02:00
indycam.h
ir-kbd-i2c.c [media] ir-kbd-i2c: pass device code w/key in hauppauge case 2011-03-22 19:24:18 -03:00
Kconfig [media] V4L: mx3_camera: select VIDEOBUF2_DMA_CONTIG instead of VIDEOBUF_DMA_CONTIG 2011-04-13 09:56:54 -03:00
ks0127.c V4L/DVB: ks0127: remove obsolete v4l2_i2c_drv.h header 2010-10-21 01:06:04 -02:00
ks0127.h
m52790.c [media] v4l: make sure drivers supply a zeroed struct v4l2_subdev 2011-04-29 12:33:28 -03:00
Makefile [media] omap3isp: Kconfig and Makefile 2011-03-22 04:53:54 -03:00
mem2mem_testdev.c [media] Update Pawel Osciak's e-mail address 2011-03-22 04:55:05 -03:00
meye.c [media] v4l2-ioctl: add priority handling support 2011-03-22 16:37:59 -03:00
meye.h
msp3400-driver.c Fix common misspellings 2011-03-31 11:26:23 -03:00
msp3400-driver.h
msp3400-kthreads.c Fix common misspellings 2011-03-31 11:26:23 -03:00
mt9m001.c [media] v4l: Rename V4L2_MBUS_FMT_GREY8_1X8 to V4L2_MBUS_FMT_Y8_1X8 2011-03-22 04:53:23 -03:00
mt9m111.c [media] media: video: do not clear 'driver' from an i2c_client 2010-12-29 08:16:47 -02:00
mt9t031.c [media] media: video: do not clear 'driver' from an i2c_client 2010-12-29 08:16:47 -02:00
mt9t112.c
mt9v011.c [media] v4l2-subdev: remove core.s_config and v4l2_i2c_new_subdev_cfg() 2011-01-19 11:45:30 -02:00
mt9v022.c [media] v4l: Rename V4L2_MBUS_FMT_GREY8_1X8 to V4L2_MBUS_FMT_Y8_1X8 2011-03-22 04:53:23 -03:00
mx1_camera.c [media] v4l: soc-camera: switch to .unlocked_ioctl 2010-12-30 22:29:26 -02:00
mx2_camera.c [media] v4l: soc-camera: switch to .unlocked_ioctl 2010-12-30 22:29:26 -02:00
mx3_camera.c [media] V4L: mx3_camera: convert to videobuf2 2011-03-21 20:32:15 -03:00
mxb.c [media] v4l2-ioctl: add priority handling support 2011-03-22 16:37:59 -03:00
mxb.h
noon010pc30.c [media] Add v4l2 subdev driver for NOON010PC30L image sensor 2011-03-21 20:31:40 -03:00
omap1_camera.c Fix common misspellings 2011-03-31 11:26:23 -03:00
omap24xxcam-dma.c
omap24xxcam.c [media] omap24xxcam: Fix compilation 2011-03-21 20:32:19 -03:00
omap24xxcam.h
ov772x.c [media] v4l: ov772x: simplify pointer dereference 2010-12-30 22:29:23 -02:00
ov2640.c [media] V4L2: Add a v4l2-subdev (soc-camera) driver for OmniVision OV2640 sensor 2010-12-30 22:29:34 -02:00
ov6650.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ov7670.c [media] v4l2-subdev: remove core.s_config and v4l2_i2c_new_subdev_cfg() 2011-01-19 11:45:30 -02:00
ov7670.h [media] ov7670: allow configuration of image size, clock speed, and I/O method 2010-10-23 13:09:23 -02:00
ov9640.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ov9640.h
ov9740.c [media] V4L: Initial submit of OV9740 driver 2011-03-21 20:32:16 -03:00
pms.c [media] BKL: trivial ioctl -> unlocked_ioctl video driver conversions 2010-12-01 20:10:10 -02:00
pxa_camera.c Fix common misspellings 2011-03-31 11:26:23 -03:00
rj54n1cb0c.c [media] media: video: do not clear 'driver' from an i2c_client 2010-12-29 08:16:47 -02:00
s2255drv.c [media] s2255drv: jpeg enable module parameter 2011-05-20 09:28:41 -03:00
saa711x_regs.h
saa717x.c
saa6588.c [media] saa6588: rename rds.h to saa6588.h 2010-12-29 08:17:18 -02:00
saa7110.c [media] saa7110: use control framework 2011-03-21 20:31:50 -03:00
saa7115.c [media] fix saa7111 non-detection 2011-01-31 14:19:50 -02:00
saa7121.h
saa7127.c V4L/DVB: saa7127: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:06:04 -02:00
saa7146.h
saa7146reg.h
saa7185.c V4L/DVB: saa7185: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:05:59 -02:00
saa7191.c V4L/DVB: saa7191: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:06:02 -02:00
saa7191.h
sh_mobile_ceu_camera.c [media] soc-camera: fix a recent multi-camera breakage on sh-mobile 2011-04-13 09:54:16 -03:00
sh_mobile_csi2.c [media] sh_mobile_csi2: fix module reloading 2011-04-13 09:55:38 -03:00
sh_vou.c Merge branch 'bkl_removal' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2010-12-17 09:28:17 -08:00
soc_camera_platform.c
soc_camera.c [media] V4L: soc-camera: regression fix: calculate .sizeimage in soc_camera.c 2011-05-04 16:47:56 -03:00
soc_mediabus.c [media] v4l: Rename V4L2_MBUS_FMT_GREY8_1X8 to V4L2_MBUS_FMT_Y8_1X8 2011-03-22 04:53:23 -03:00
sr030pc30.c [media] v4l2-subdev: remove core.s_config and v4l2_i2c_new_subdev_cfg() 2011-01-19 11:45:30 -02:00
stk-sensor.c
stk-webcam.c [media] stk-webcam: remove V4L1 compatibility code, replace with V4L2 controls 2010-12-29 08:17:09 -02:00
stk-webcam.h
tcm825x.c Fix common misspellings 2011-03-31 11:26:23 -03:00
tcm825x.h
tda7432.c V4L/DVB: tda7432: remove obsolete v4l2-i2c-drv.h header 2010-10-21 01:06:03 -02:00
tda9840.c [media] v4l: make sure drivers supply a zeroed struct v4l2_subdev 2011-04-29 12:33:28 -03:00
tea6415c.c [media] v4l: make sure drivers supply a zeroed struct v4l2_subdev 2011-04-29 12:33:28 -03:00
tea6415c.h
tea6420.c [media] v4l: make sure drivers supply a zeroed struct v4l2_subdev 2011-04-29 12:33:28 -03:00
tea6420.h
ths7303.c
timblogiw.c mfd: mfd_cell is now implicitly available to timberdale drivers 2011-03-23 10:41:52 +01:00
tlv320aic23b.c [media] tlv320aic23b: use control framework 2011-03-21 20:31:50 -03:00
tuner-core.c [media] tuner-core: Don't touch at standby during tuner_lookup 2011-03-21 20:32:03 -03:00
tvaudio.c Fix common misspellings 2011-03-31 11:26:23 -03:00
tveeprom.c [media] tveeprom: update hauppauge tuner list thru 174 2011-05-20 09:27:15 -03:00
tvp514x_regs.h
tvp514x.c [media] tvp514x: use the control framework 2011-03-21 20:31:50 -03:00
tvp5150_reg.h
tvp5150.c [media] tvp5150: device detection should be done only once 2011-03-21 20:32:04 -03:00
tvp7002_reg.h
tvp7002.c [media] tvp7002: use control framework 2011-03-21 20:31:50 -03:00
tw9910.c
upd64031a.c [media] v4l: make sure drivers supply a zeroed struct v4l2_subdev 2011-04-29 12:33:28 -03:00
upd64083.c [media] v4l: make sure drivers supply a zeroed struct v4l2_subdev 2011-04-29 12:33:28 -03:00
v4l2-common.c [media] v4l2_prio: move from v4l2-common to v4l2-dev 2011-03-22 16:37:54 -03:00
v4l2-compat-ioctl32.c [media] v4l: removal of old, obsolete ioctls 2011-03-21 20:32:12 -03:00
v4l2-ctrls.c [media] v4l2-ctrls: Fix control enumeration for multiple subdevs with ctrl 2011-03-21 20:32:04 -03:00
v4l2-dev.c [media] v4l: Don't register media entities for subdev device nodes 2011-04-19 11:29:19 -03:00
v4l2-device.c [media] v4l: Release module if subdev registration fails 2011-05-04 16:22:39 -03:00
v4l2-event.c V4L/DVB: v4l2: add core serialization lock 2010-10-21 01:06:14 -02:00
v4l2-fh.c [media] v4l2: use new flag to enable core priority handling 2011-03-22 16:38:16 -03:00
v4l2-int-device.c
v4l2-ioctl.c Fix common misspellings 2011-03-31 11:26:23 -03:00
v4l2-mem2mem.c [media] Update Pawel Osciak's e-mail address 2011-03-22 04:55:05 -03:00
v4l2-subdev.c [media] v4l2-subdev: fix broken subdev control enumeration 2011-05-04 16:42:55 -03:00
via-camera.c [media] via-camera: Fix OLPC serial check 2011-03-22 16:37:49 -03:00
via-camera.h [media] Add the via framebuffer camera controller driver 2010-10-21 13:45:28 -02:00
videobuf2-core.c [media] media: vb2: correct queue initialization order 2011-04-19 16:07:34 -03:00
videobuf2-dma-contig.c [media] videobuf2: fix an error message 2011-04-13 09:52:36 -03:00
videobuf2-dma-sg.c [media] v4l2: vb2-dma-sg: fix potential security hole 2011-03-22 04:54:30 -03:00
videobuf2-memops.c [media] Update Pawel Osciak's e-mail address 2011-03-22 04:55:05 -03:00
videobuf2-vmalloc.c [media] Update Pawel Osciak's e-mail address 2011-03-22 04:55:05 -03:00
videobuf-core.c [media] V4L: remove V4L1 compatibility mode 2010-12-29 08:17:07 -02:00
videobuf-dma-contig.c Revert "[media] V4L: videobuf, don't use dma addr as physical" 2011-04-19 10:54:44 -07:00
videobuf-dma-sg.c [media] videobuf-dma-sg: remove obsolete comments 2010-12-29 08:17:07 -02:00
videobuf-dvb.c V4L/DVB: videobuf: add queue argument to videobuf_waiton() 2010-10-21 01:06:14 -02:00
videobuf-vmalloc.c V4L/DVB: videobuf: add ext_lock argument to the queue init functions 2010-10-21 01:06:14 -02:00
vino.c [media] v4l: fix handling of v4l2_input.capabilities 2010-12-30 08:02:29 -02:00
vino.h
vivi.c [media] v4l2: use new flag to enable core priority handling 2011-03-22 16:38:16 -03:00
vp27smpx.c
vpx3220.c Fix common misspellings 2011-03-31 11:26:23 -03:00
w9966.c [media] w9966: zero device state after a detach 2011-01-19 11:52:11 -02:00
wm8739.c
wm8775.c [media] Add proper audio support for Nova-S Plus with wm8775 ADC 2011-03-21 20:32:19 -03:00
zr364xx.c V4L/DVB: videobuf: add ext_lock argument to the queue init functions 2010-10-21 01:06:14 -02:00