linux/drivers/media/video/cx88
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
..
cx88-alsa.c [media] cx88-alsa: fix compiler warning 2011-03-22 04:54:03 -03:00
cx88-blackbird.c [media] cx88: protect per-device driver list with device lock 2011-05-20 09:29:34 -03:00
cx88-cards.c [media] cx88: add support for TeVii S464 PCI card 2011-03-21 20:32:27 -03:00
cx88-core.c V4L/DVB: videobuf: add queue argument to videobuf_waiton() 2010-10-21 01:06:14 -02:00
cx88-dsp.c V4L/DVB: drivers/media: Make static data tables and strings const 2010-10-21 01:04:52 -02:00
cx88-dvb.c [media] cx88: protect per-device driver list with device lock 2011-05-20 09:29:34 -03:00
cx88-i2c.c [media] cx88: Remove the obsolete i2c_adapter.id field 2010-12-30 12:17:19 -02:00
cx88-input.c [media] Fix cx88 remote control input 2011-05-04 16:30:20 -03:00
cx88-mpeg.c [media] cx88: protect per-device driver list with device lock 2011-05-20 09:29:34 -03:00
cx88-reg.h
cx88-tvaudio.c [media] Add proper audio support for Nova-S Plus with wm8775 ADC 2011-03-21 20:32:19 -03:00
cx88-vbi.c V4L/DVB: drivers/media: Make static data tables and strings const 2010-10-21 01:04:52 -02:00
cx88-video.c [media] use pci_dev->revision 2011-05-20 07:26:16 -03:00
cx88-vp3054-i2c.c [media] cx88: Remove the obsolete i2c_adapter.id field 2010-12-30 12:17:19 -02:00
cx88-vp3054-i2c.h
cx88.h [media] cx88: protect per-device driver list with device lock 2011-05-20 09:29:34 -03:00
Kconfig [media] rc: rename the remaining things to rc_core 2010-12-29 08:16:50 -02:00
Makefile V4L/DVB (11394): cx88: Add support for stereo and sap detection for A2 2009-06-16 19:14:17 -03:00