aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 13:43:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 13:43:11 -0400
commit5704e44d283e907623e3775c1262f206a2c48cf3 (patch)
tree0a981b24173e90854e7b7d812b35859e1e5f0174 /drivers/media
parent91151240ed8e97cc4457dae4094153c2744f1eb8 (diff)
parent6de5bd128d381ad88ac6d419a5e597048eb468cf (diff)
Merge branch 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl
* 'config' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl: BKL: introduce CONFIG_BKL. dabusb: remove the BKL sunrpc: remove the big kernel lock init/main.c: remove BKL notations blktrace: remove the big kernel lock rtmutex-tester: make it build without BKL dvb-core: kill the big kernel lock dvb/bt8xx: kill the big kernel lock tlclk: remove big kernel lock fix rawctl compat ioctls breakage on amd64 and itanic uml: kill big kernel lock parisc: remove big kernel lock cris: autoconvert trivial BKL users alpha: kill big kernel lock isapnp: BKL removal s390/block: kill the big kernel lock hpet: kill BKL, add compat_ioctl
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/Kconfig1
-rw-r--r--drivers/media/dvb/bt8xx/dst_ca.c7
-rw-r--r--drivers/media/dvb/dvb-core/dmxdev.c17
-rw-r--r--drivers/media/dvb/dvb-core/dvb_ca_en50221.c8
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c9
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c17
-rw-r--r--drivers/media/video/dabusb.c18
7 files changed, 19 insertions, 58 deletions
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index a28541b2b1a2..bad2cedb8d96 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -19,6 +19,7 @@ comment "Multimedia core support"
19 19
20config VIDEO_DEV 20config VIDEO_DEV
21 tristate "Video For Linux" 21 tristate "Video For Linux"
22 depends on BKL # used in many drivers for ioctl handling, need to kill
22 ---help--- 23 ---help---
23 V4L core support for video capture and overlay devices, webcams and 24 V4L core support for video capture and overlay devices, webcams and
24 AM/FM radio cards. 25 AM/FM radio cards.
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index cf8705162845..d75788b4e22e 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -22,7 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/smp_lock.h> 25#include <linux/mutex.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/dvb/ca.h> 27#include <linux/dvb/ca.h>
28#include "dvbdev.h" 28#include "dvbdev.h"
@@ -52,6 +52,7 @@
52} while(0) 52} while(0)
53 53
54 54
55static DEFINE_MUTEX(dst_ca_mutex);
55static unsigned int verbose = 5; 56static unsigned int verbose = 5;
56module_param(verbose, int, 0644); 57module_param(verbose, int, 0644);
57MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)"); 58MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)");
@@ -564,7 +565,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
564 void __user *arg = (void __user *)ioctl_arg; 565 void __user *arg = (void __user *)ioctl_arg;
565 int result = 0; 566 int result = 0;
566 567
567 lock_kernel(); 568 mutex_lock(&dst_ca_mutex);
568 dvbdev = file->private_data; 569 dvbdev = file->private_data;
569 state = (struct dst_state *)dvbdev->priv; 570 state = (struct dst_state *)dvbdev->priv;
570 p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); 571 p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL);
@@ -652,7 +653,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
652 kfree (p_ca_slot_info); 653 kfree (p_ca_slot_info);
653 kfree (p_ca_caps); 654 kfree (p_ca_caps);
654 655
655 unlock_kernel(); 656 mutex_unlock(&dst_ca_mutex);
656 return result; 657 return result;
657} 658}
658 659
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c
index 0042306ea11b..2de13b04b09d 100644
--- a/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/drivers/media/dvb/dvb-core/dmxdev.c
@@ -25,7 +25,6 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/vmalloc.h> 26#include <linux/vmalloc.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/smp_lock.h>
29#include <linux/poll.h> 28#include <linux/poll.h>
30#include <linux/ioctl.h> 29#include <linux/ioctl.h>
31#include <linux/wait.h> 30#include <linux/wait.h>
@@ -1088,13 +1087,7 @@ static int dvb_demux_do_ioctl(struct file *file,
1088static long dvb_demux_ioctl(struct file *file, unsigned int cmd, 1087static long dvb_demux_ioctl(struct file *file, unsigned int cmd,
1089 unsigned long arg) 1088 unsigned long arg)
1090{ 1089{
1091 int ret; 1090 return dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
1092
1093 lock_kernel();
1094 ret = dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
1095 unlock_kernel();
1096
1097 return ret;
1098} 1091}
1099 1092
1100static unsigned int dvb_demux_poll(struct file *file, poll_table *wait) 1093static unsigned int dvb_demux_poll(struct file *file, poll_table *wait)
@@ -1186,13 +1179,7 @@ static int dvb_dvr_do_ioctl(struct file *file,
1186static long dvb_dvr_ioctl(struct file *file, 1179static long dvb_dvr_ioctl(struct file *file,
1187 unsigned int cmd, unsigned long arg) 1180 unsigned int cmd, unsigned long arg)
1188{ 1181{
1189 int ret; 1182 return dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
1190
1191 lock_kernel();
1192 ret = dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
1193 unlock_kernel();
1194
1195 return ret;
1196} 1183}
1197 1184
1198static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait) 1185static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait)
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index cb97e6b85432..1723a984a522 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -1259,13 +1259,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
1259static long dvb_ca_en50221_io_ioctl(struct file *file, 1259static long dvb_ca_en50221_io_ioctl(struct file *file,
1260 unsigned int cmd, unsigned long arg) 1260 unsigned int cmd, unsigned long arg)
1261{ 1261{
1262 int ret; 1262 return dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
1263
1264 lock_kernel();
1265 ret = dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
1266 unlock_kernel();
1267
1268 return ret;
1269} 1263}
1270 1264
1271 1265
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index 6c3a8a06ccab..a08032284cbf 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -59,7 +59,6 @@
59#include <linux/netdevice.h> 59#include <linux/netdevice.h>
60#include <linux/etherdevice.h> 60#include <linux/etherdevice.h>
61#include <linux/dvb/net.h> 61#include <linux/dvb/net.h>
62#include <linux/smp_lock.h>
63#include <linux/uio.h> 62#include <linux/uio.h>
64#include <asm/uaccess.h> 63#include <asm/uaccess.h>
65#include <linux/crc32.h> 64#include <linux/crc32.h>
@@ -1445,13 +1444,7 @@ static int dvb_net_do_ioctl(struct file *file,
1445static long dvb_net_ioctl(struct file *file, 1444static long dvb_net_ioctl(struct file *file,
1446 unsigned int cmd, unsigned long arg) 1445 unsigned int cmd, unsigned long arg)
1447{ 1446{
1448 int ret; 1447 return dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
1449
1450 lock_kernel();
1451 ret = dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
1452 unlock_kernel();
1453
1454 return ret;
1455} 1448}
1456 1449
1457static int dvb_net_close(struct inode *inode, struct file *file) 1450static int dvb_net_close(struct inode *inode, struct file *file)
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index b915c39d782f..28f486edcaf0 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -32,9 +32,9 @@
32#include <linux/fs.h> 32#include <linux/fs.h>
33#include <linux/cdev.h> 33#include <linux/cdev.h>
34#include <linux/mutex.h> 34#include <linux/mutex.h>
35#include <linux/smp_lock.h>
36#include "dvbdev.h" 35#include "dvbdev.h"
37 36
37static DEFINE_MUTEX(dvbdev_mutex);
38static int dvbdev_debug; 38static int dvbdev_debug;
39 39
40module_param(dvbdev_debug, int, 0644); 40module_param(dvbdev_debug, int, 0644);
@@ -68,7 +68,7 @@ static int dvb_device_open(struct inode *inode, struct file *file)
68{ 68{
69 struct dvb_device *dvbdev; 69 struct dvb_device *dvbdev;
70 70
71 lock_kernel(); 71 mutex_lock(&dvbdev_mutex);
72 down_read(&minor_rwsem); 72 down_read(&minor_rwsem);
73 dvbdev = dvb_minors[iminor(inode)]; 73 dvbdev = dvb_minors[iminor(inode)];
74 74
@@ -91,12 +91,12 @@ static int dvb_device_open(struct inode *inode, struct file *file)
91 } 91 }
92 fops_put(old_fops); 92 fops_put(old_fops);
93 up_read(&minor_rwsem); 93 up_read(&minor_rwsem);
94 unlock_kernel(); 94 mutex_unlock(&dvbdev_mutex);
95 return err; 95 return err;
96 } 96 }
97fail: 97fail:
98 up_read(&minor_rwsem); 98 up_read(&minor_rwsem);
99 unlock_kernel(); 99 mutex_unlock(&dvbdev_mutex);
100 return -ENODEV; 100 return -ENODEV;
101} 101}
102 102
@@ -158,7 +158,6 @@ long dvb_generic_ioctl(struct file *file,
158 unsigned int cmd, unsigned long arg) 158 unsigned int cmd, unsigned long arg)
159{ 159{
160 struct dvb_device *dvbdev = file->private_data; 160 struct dvb_device *dvbdev = file->private_data;
161 int ret;
162 161
163 if (!dvbdev) 162 if (!dvbdev)
164 return -ENODEV; 163 return -ENODEV;
@@ -166,11 +165,7 @@ long dvb_generic_ioctl(struct file *file,
166 if (!dvbdev->kernel_ioctl) 165 if (!dvbdev->kernel_ioctl)
167 return -EINVAL; 166 return -EINVAL;
168 167
169 lock_kernel(); 168 return dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl);
170 ret = dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl);
171 unlock_kernel();
172
173 return ret;
174} 169}
175EXPORT_SYMBOL(dvb_generic_ioctl); 170EXPORT_SYMBOL(dvb_generic_ioctl);
176 171
@@ -421,8 +416,10 @@ int dvb_usercopy(struct file *file,
421 } 416 }
422 417
423 /* call driver */ 418 /* call driver */
419 mutex_lock(&dvbdev_mutex);
424 if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD) 420 if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD)
425 err = -EINVAL; 421 err = -EINVAL;
422 mutex_unlock(&dvbdev_mutex);
426 423
427 if (err < 0) 424 if (err < 0)
428 goto out; 425 goto out;
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c
index 5b176bd7afdb..f3e25e91366d 100644
--- a/drivers/media/video/dabusb.c
+++ b/drivers/media/video/dabusb.c
@@ -32,7 +32,6 @@
32#include <linux/list.h> 32#include <linux/list.h>
33#include <linux/vmalloc.h> 33#include <linux/vmalloc.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/smp_lock.h>
36#include <linux/init.h> 35#include <linux/init.h>
37#include <asm/uaccess.h> 36#include <asm/uaccess.h>
38#include <asm/atomic.h> 37#include <asm/atomic.h>
@@ -621,7 +620,6 @@ static int dabusb_open (struct inode *inode, struct file *file)
621 if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB)) 620 if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB))
622 return -EIO; 621 return -EIO;
623 622
624 lock_kernel();
625 s = &dabusb[devnum - DABUSB_MINOR]; 623 s = &dabusb[devnum - DABUSB_MINOR];
626 624
627 dbg("dabusb_open"); 625 dbg("dabusb_open");
@@ -630,21 +628,17 @@ static int dabusb_open (struct inode *inode, struct file *file)
630 while (!s->usbdev || s->opened) { 628 while (!s->usbdev || s->opened) {
631 mutex_unlock(&s->mutex); 629 mutex_unlock(&s->mutex);
632 630
633 if (file->f_flags & O_NONBLOCK) { 631 if (file->f_flags & O_NONBLOCK)
634 return -EBUSY; 632 return -EBUSY;
635 }
636 msleep_interruptible(500); 633 msleep_interruptible(500);
637 634
638 if (signal_pending (current)) { 635 if (signal_pending (current))
639 unlock_kernel();
640 return -EAGAIN; 636 return -EAGAIN;
641 }
642 mutex_lock(&s->mutex); 637 mutex_lock(&s->mutex);
643 } 638 }
644 if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) { 639 if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
645 mutex_unlock(&s->mutex); 640 mutex_unlock(&s->mutex);
646 dev_err(&s->usbdev->dev, "set_interface failed\n"); 641 dev_err(&s->usbdev->dev, "set_interface failed\n");
647 unlock_kernel();
648 return -EINVAL; 642 return -EINVAL;
649 } 643 }
650 s->opened = 1; 644 s->opened = 1;
@@ -654,7 +648,6 @@ static int dabusb_open (struct inode *inode, struct file *file)
654 file->private_data = s; 648 file->private_data = s;
655 649
656 r = nonseekable_open(inode, file); 650 r = nonseekable_open(inode, file);
657 unlock_kernel();
658 return r; 651 return r;
659} 652}
660 653
@@ -689,17 +682,13 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg
689 682
690 dbg("dabusb_ioctl"); 683 dbg("dabusb_ioctl");
691 684
692 lock_kernel(); 685 if (s->remove_pending)
693 if (s->remove_pending) {
694 unlock_kernel();
695 return -EIO; 686 return -EIO;
696 }
697 687
698 mutex_lock(&s->mutex); 688 mutex_lock(&s->mutex);
699 689
700 if (!s->usbdev) { 690 if (!s->usbdev) {
701 mutex_unlock(&s->mutex); 691 mutex_unlock(&s->mutex);
702 unlock_kernel();
703 return -EIO; 692 return -EIO;
704 } 693 }
705 694
@@ -735,7 +724,6 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg
735 break; 724 break;
736 } 725 }
737 mutex_unlock(&s->mutex); 726 mutex_unlock(&s->mutex);
738 unlock_kernel();
739 return ret; 727 return ret;
740} 728}
741 729