summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-device.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-11-26 10:47:28 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-12-01 23:10:19 +0100
commit879aa24d6394aa04b690a600a41ff500441ad384 (patch)
tree024886e8a84ab3f7e88c1e2c5aeceae28cc344bb /drivers/media/video/v4l2-device.c
parent[media] v4l2-dev: use mutex_lock_interruptible instead of plain mutex_lock (diff)
downloadlinux-879aa24d6394aa04b690a600a41ff500441ad384.tar.xz
linux-879aa24d6394aa04b690a600a41ff500441ad384.zip
[media] V4L: improve the BKL replacement heuristic
The BKL replacement mutex had some serious performance side-effects on V4L drivers. It is replaced by a better heuristic that works around the worst of the side-effects. Read the v4l2-dev.c comments for the whole sorry story. This is a temporary measure only until we can convert all v4l drivers to use unlocked_ioctl. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-device.c')
-rw-r--r--drivers/media/video/v4l2-device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c
index 0b08f96b74a5..7fe6f92af480 100644
--- a/drivers/media/video/v4l2-device.c
+++ b/drivers/media/video/v4l2-device.c
@@ -35,6 +35,7 @@ int v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev)
INIT_LIST_HEAD(&v4l2_dev->subdevs);
spin_lock_init(&v4l2_dev->lock);
+ mutex_init(&v4l2_dev->ioctl_lock);
v4l2_dev->dev = dev;
if (dev == NULL) {
/* If dev == NULL, then name must be filled in by the caller */