aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/char/hpet.c98
-rw-r--r--drivers/char/raw.c243
-rw-r--r--drivers/char/tlclk.c6
-rw-r--r--drivers/gpu/drm/Kconfig5
-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
-rw-r--r--drivers/net/appletalk/Kconfig1
-rw-r--r--drivers/pnp/isapnp/proc.c15
-rw-r--r--drivers/s390/block/dasd.c6
-rw-r--r--drivers/s390/block/dasd_ioctl.c17
-rw-r--r--drivers/s390/block/dcssblk.c5
-rw-r--r--drivers/staging/cx25821/Kconfig1
-rw-r--r--drivers/staging/easycap/Kconfig1
-rw-r--r--drivers/staging/go7007/Kconfig1
-rw-r--r--drivers/staging/usbip/Kconfig2
20 files changed, 245 insertions, 233 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index a0a1829d3198..a4eee324eb1e 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -30,6 +30,7 @@
30#include <linux/bcd.h> 30#include <linux/bcd.h>
31#include <linux/seq_file.h> 31#include <linux/seq_file.h>
32#include <linux/bitops.h> 32#include <linux/bitops.h>
33#include <linux/compat.h>
33#include <linux/clocksource.h> 34#include <linux/clocksource.h>
34#include <linux/slab.h> 35#include <linux/slab.h>
35 36
@@ -67,6 +68,7 @@
67#define read_counter(MC) readl(MC) 68#define read_counter(MC) readl(MC)
68#endif 69#endif
69 70
71static DEFINE_MUTEX(hpet_mutex); /* replaces BKL */
70static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ; 72static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
71 73
72/* This clocksource driver currently only works on ia64 */ 74/* This clocksource driver currently only works on ia64 */
@@ -250,7 +252,7 @@ static int hpet_open(struct inode *inode, struct file *file)
250 if (file->f_mode & FMODE_WRITE) 252 if (file->f_mode & FMODE_WRITE)
251 return -EINVAL; 253 return -EINVAL;
252 254
253 lock_kernel(); 255 mutex_lock(&hpet_mutex);
254 spin_lock_irq(&hpet_lock); 256 spin_lock_irq(&hpet_lock);
255 257
256 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) 258 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next)
@@ -264,7 +266,7 @@ static int hpet_open(struct inode *inode, struct file *file)
264 266
265 if (!devp) { 267 if (!devp) {
266 spin_unlock_irq(&hpet_lock); 268 spin_unlock_irq(&hpet_lock);
267 unlock_kernel(); 269 mutex_unlock(&hpet_mutex);
268 return -EBUSY; 270 return -EBUSY;
269 } 271 }
270 272
@@ -272,7 +274,7 @@ static int hpet_open(struct inode *inode, struct file *file)
272 devp->hd_irqdata = 0; 274 devp->hd_irqdata = 0;
273 devp->hd_flags |= HPET_OPEN; 275 devp->hd_flags |= HPET_OPEN;
274 spin_unlock_irq(&hpet_lock); 276 spin_unlock_irq(&hpet_lock);
275 unlock_kernel(); 277 mutex_unlock(&hpet_mutex);
276 278
277 hpet_timer_set_irq(devp); 279 hpet_timer_set_irq(devp);
278 280
@@ -429,22 +431,6 @@ static int hpet_release(struct inode *inode, struct file *file)
429 return 0; 431 return 0;
430} 432}
431 433
432static int hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int);
433
434static long hpet_ioctl(struct file *file, unsigned int cmd,
435 unsigned long arg)
436{
437 struct hpet_dev *devp;
438 int ret;
439
440 devp = file->private_data;
441 lock_kernel();
442 ret = hpet_ioctl_common(devp, cmd, arg, 0);
443 unlock_kernel();
444
445 return ret;
446}
447
448static int hpet_ioctl_ieon(struct hpet_dev *devp) 434static int hpet_ioctl_ieon(struct hpet_dev *devp)
449{ 435{
450 struct hpet_timer __iomem *timer; 436 struct hpet_timer __iomem *timer;
@@ -553,7 +539,8 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
553} 539}
554 540
555static int 541static int
556hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) 542hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg,
543 struct hpet_info *info)
557{ 544{
558 struct hpet_timer __iomem *timer; 545 struct hpet_timer __iomem *timer;
559 struct hpet __iomem *hpet; 546 struct hpet __iomem *hpet;
@@ -594,23 +581,15 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
594 break; 581 break;
595 case HPET_INFO: 582 case HPET_INFO:
596 { 583 {
597 struct hpet_info info;
598
599 if (devp->hd_ireqfreq) 584 if (devp->hd_ireqfreq)
600 info.hi_ireqfreq = 585 info->hi_ireqfreq =
601 hpet_time_div(hpetp, devp->hd_ireqfreq); 586 hpet_time_div(hpetp, devp->hd_ireqfreq);
602 else 587 else
603 info.hi_ireqfreq = 0; 588 info->hi_ireqfreq = 0;
604 info.hi_flags = 589 info->hi_flags =
605 readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK; 590 readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK;
606 info.hi_hpet = hpetp->hp_which; 591 info->hi_hpet = hpetp->hp_which;
607 info.hi_timer = devp - hpetp->hp_dev; 592 info->hi_timer = devp - hpetp->hp_dev;
608 if (kernel)
609 memcpy((void *)arg, &info, sizeof(info));
610 else
611 if (copy_to_user((void __user *)arg, &info,
612 sizeof(info)))
613 err = -EFAULT;
614 break; 593 break;
615 } 594 }
616 case HPET_EPI: 595 case HPET_EPI:
@@ -636,7 +615,7 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
636 devp->hd_flags &= ~HPET_PERIODIC; 615 devp->hd_flags &= ~HPET_PERIODIC;
637 break; 616 break;
638 case HPET_IRQFREQ: 617 case HPET_IRQFREQ:
639 if (!kernel && (arg > hpet_max_freq) && 618 if ((arg > hpet_max_freq) &&
640 !capable(CAP_SYS_RESOURCE)) { 619 !capable(CAP_SYS_RESOURCE)) {
641 err = -EACCES; 620 err = -EACCES;
642 break; 621 break;
@@ -653,12 +632,63 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
653 return err; 632 return err;
654} 633}
655 634
635static long
636hpet_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
637{
638 struct hpet_info info;
639 int err;
640
641 mutex_lock(&hpet_mutex);
642 err = hpet_ioctl_common(file->private_data, cmd, arg, &info);
643 mutex_unlock(&hpet_mutex);
644
645 if ((cmd == HPET_INFO) && !err &&
646 (copy_to_user((void __user *)arg, &info, sizeof(info))))
647 err = -EFAULT;
648
649 return err;
650}
651
652#ifdef CONFIG_COMPAT
653struct compat_hpet_info {
654 compat_ulong_t hi_ireqfreq; /* Hz */
655 compat_ulong_t hi_flags; /* information */
656 unsigned short hi_hpet;
657 unsigned short hi_timer;
658};
659
660static long
661hpet_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
662{
663 struct hpet_info info;
664 int err;
665
666 mutex_lock(&hpet_mutex);
667 err = hpet_ioctl_common(file->private_data, cmd, arg, &info);
668 mutex_unlock(&hpet_mutex);
669
670 if ((cmd == HPET_INFO) && !err) {
671 struct compat_hpet_info __user *u = compat_ptr(arg);
672 if (put_user(info.hi_ireqfreq, &u->hi_ireqfreq) ||
673 put_user(info.hi_flags, &u->hi_flags) ||
674 put_user(info.hi_hpet, &u->hi_hpet) ||
675 put_user(info.hi_timer, &u->hi_timer))
676 err = -EFAULT;
677 }
678
679 return err;
680}
681#endif
682
656static const struct file_operations hpet_fops = { 683static const struct file_operations hpet_fops = {
657 .owner = THIS_MODULE, 684 .owner = THIS_MODULE,
658 .llseek = no_llseek, 685 .llseek = no_llseek,
659 .read = hpet_read, 686 .read = hpet_read,
660 .poll = hpet_poll, 687 .poll = hpet_poll,
661 .unlocked_ioctl = hpet_ioctl, 688 .unlocked_ioctl = hpet_ioctl,
689#ifdef CONFIG_COMPAT
690 .compat_ioctl = hpet_compat_ioctl,
691#endif
662 .open = hpet_open, 692 .open = hpet_open,
663 .release = hpet_release, 693 .release = hpet_release,
664 .fasync = hpet_fasync, 694 .fasync = hpet_fasync,
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index b38942f6bf31..24b2b9160aa6 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -19,8 +19,8 @@
19#include <linux/cdev.h> 19#include <linux/cdev.h>
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22#include <linux/smp_lock.h>
23#include <linux/gfp.h> 22#include <linux/gfp.h>
23#include <linux/compat.h>
24 24
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26 26
@@ -55,7 +55,6 @@ static int raw_open(struct inode *inode, struct file *filp)
55 return 0; 55 return 0;
56 } 56 }
57 57
58 lock_kernel();
59 mutex_lock(&raw_mutex); 58 mutex_lock(&raw_mutex);
60 59
61 /* 60 /*
@@ -82,7 +81,6 @@ static int raw_open(struct inode *inode, struct file *filp)
82 bdev->bd_inode->i_mapping; 81 bdev->bd_inode->i_mapping;
83 filp->private_data = bdev; 82 filp->private_data = bdev;
84 mutex_unlock(&raw_mutex); 83 mutex_unlock(&raw_mutex);
85 unlock_kernel();
86 return 0; 84 return 0;
87 85
88out2: 86out2:
@@ -91,7 +89,6 @@ out1:
91 blkdev_put(bdev, filp->f_mode); 89 blkdev_put(bdev, filp->f_mode);
92out: 90out:
93 mutex_unlock(&raw_mutex); 91 mutex_unlock(&raw_mutex);
94 unlock_kernel();
95 return err; 92 return err;
96} 93}
97 94
@@ -125,20 +122,84 @@ static long
125raw_ioctl(struct file *filp, unsigned int command, unsigned long arg) 122raw_ioctl(struct file *filp, unsigned int command, unsigned long arg)
126{ 123{
127 struct block_device *bdev = filp->private_data; 124 struct block_device *bdev = filp->private_data;
128 int ret; 125 return blkdev_ioctl(bdev, 0, command, arg);
126}
127
128static int bind_set(int number, u64 major, u64 minor)
129{
130 dev_t dev = MKDEV(major, minor);
131 struct raw_device_data *rawdev;
132 int err = 0;
129 133
130 lock_kernel(); 134 if (number <= 0 || number >= MAX_RAW_MINORS)
131 ret = blkdev_ioctl(bdev, 0, command, arg); 135 return -EINVAL;
132 unlock_kernel();
133 136
134 return ret; 137 if (MAJOR(dev) != major || MINOR(dev) != minor)
138 return -EINVAL;
139
140 rawdev = &raw_devices[number];
141
142 /*
143 * This is like making block devices, so demand the
144 * same capability
145 */
146 if (!capable(CAP_SYS_ADMIN))
147 return -EPERM;
148
149 /*
150 * For now, we don't need to check that the underlying
151 * block device is present or not: we can do that when
152 * the raw device is opened. Just check that the
153 * major/minor numbers make sense.
154 */
155
156 if (MAJOR(dev) == 0 && dev != 0)
157 return -EINVAL;
158
159 mutex_lock(&raw_mutex);
160 if (rawdev->inuse) {
161 mutex_unlock(&raw_mutex);
162 return -EBUSY;
163 }
164 if (rawdev->binding) {
165 bdput(rawdev->binding);
166 module_put(THIS_MODULE);
167 }
168 if (!dev) {
169 /* unbind */
170 rawdev->binding = NULL;
171 device_destroy(raw_class, MKDEV(RAW_MAJOR, number));
172 } else {
173 rawdev->binding = bdget(dev);
174 if (rawdev->binding == NULL) {
175 err = -ENOMEM;
176 } else {
177 dev_t raw = MKDEV(RAW_MAJOR, number);
178 __module_get(THIS_MODULE);
179 device_destroy(raw_class, raw);
180 device_create(raw_class, NULL, raw, NULL,
181 "raw%d", number);
182 }
183 }
184 mutex_unlock(&raw_mutex);
185 return err;
135} 186}
136 187
137static void bind_device(struct raw_config_request *rq) 188static int bind_get(int number, dev_t *dev)
138{ 189{
139 device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor)); 190 struct raw_device_data *rawdev;
140 device_create(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor), NULL, 191 struct block_device *bdev;
141 "raw%d", rq->raw_minor); 192
193 if (number <= 0 || number >= MAX_RAW_MINORS)
194 return -EINVAL;
195
196 rawdev = &raw_devices[number];
197
198 mutex_lock(&raw_mutex);
199 bdev = rawdev->binding;
200 *dev = bdev ? bdev->bd_dev : 0;
201 mutex_unlock(&raw_mutex);
202 return 0;
142} 203}
143 204
144/* 205/*
@@ -149,105 +210,78 @@ static long raw_ctl_ioctl(struct file *filp, unsigned int command,
149 unsigned long arg) 210 unsigned long arg)
150{ 211{
151 struct raw_config_request rq; 212 struct raw_config_request rq;
152 struct raw_device_data *rawdev; 213 dev_t dev;
153 int err = 0; 214 int err;
154 215
155 lock_kernel();
156 switch (command) { 216 switch (command) {
157 case RAW_SETBIND: 217 case RAW_SETBIND:
218 if (copy_from_user(&rq, (void __user *) arg, sizeof(rq)))
219 return -EFAULT;
220
221 return bind_set(rq.raw_minor, rq.block_major, rq.block_minor);
222
158 case RAW_GETBIND: 223 case RAW_GETBIND:
224 if (copy_from_user(&rq, (void __user *) arg, sizeof(rq)))
225 return -EFAULT;
159 226
160 /* First, find out which raw minor we want */ 227 err = bind_get(rq.raw_minor, &dev);
228 if (err)
229 return err;
161 230
162 if (copy_from_user(&rq, (void __user *) arg, sizeof(rq))) { 231 rq.block_major = MAJOR(dev);
163 err = -EFAULT; 232 rq.block_minor = MINOR(dev);
164 goto out;
165 }
166 233
167 if (rq.raw_minor <= 0 || rq.raw_minor >= MAX_RAW_MINORS) { 234 if (copy_to_user((void __user *)arg, &rq, sizeof(rq)))
168 err = -EINVAL; 235 return -EFAULT;
169 goto out; 236
170 } 237 return 0;
171 rawdev = &raw_devices[rq.raw_minor];
172
173 if (command == RAW_SETBIND) {
174 dev_t dev;
175
176 /*
177 * This is like making block devices, so demand the
178 * same capability
179 */
180 if (!capable(CAP_SYS_ADMIN)) {
181 err = -EPERM;
182 goto out;
183 }
184
185 /*
186 * For now, we don't need to check that the underlying
187 * block device is present or not: we can do that when
188 * the raw device is opened. Just check that the
189 * major/minor numbers make sense.
190 */
191
192 dev = MKDEV(rq.block_major, rq.block_minor);
193 if ((rq.block_major == 0 && rq.block_minor != 0) ||
194 MAJOR(dev) != rq.block_major ||
195 MINOR(dev) != rq.block_minor) {
196 err = -EINVAL;
197 goto out;
198 }
199
200 mutex_lock(&raw_mutex);
201 if (rawdev->inuse) {
202 mutex_unlock(&raw_mutex);
203 err = -EBUSY;
204 goto out;
205 }
206 if (rawdev->binding) {
207 bdput(rawdev->binding);
208 module_put(THIS_MODULE);
209 }
210 if (rq.block_major == 0 && rq.block_minor == 0) {
211 /* unbind */
212 rawdev->binding = NULL;
213 device_destroy(raw_class,
214 MKDEV(RAW_MAJOR, rq.raw_minor));
215 } else {
216 rawdev->binding = bdget(dev);
217 if (rawdev->binding == NULL)
218 err = -ENOMEM;
219 else {
220 __module_get(THIS_MODULE);
221 bind_device(&rq);
222 }
223 }
224 mutex_unlock(&raw_mutex);
225 } else {
226 struct block_device *bdev;
227
228 mutex_lock(&raw_mutex);
229 bdev = rawdev->binding;
230 if (bdev) {
231 rq.block_major = MAJOR(bdev->bd_dev);
232 rq.block_minor = MINOR(bdev->bd_dev);
233 } else {
234 rq.block_major = rq.block_minor = 0;
235 }
236 mutex_unlock(&raw_mutex);
237 if (copy_to_user((void __user *)arg, &rq, sizeof(rq))) {
238 err = -EFAULT;
239 goto out;
240 }
241 }
242 break;
243 default:
244 err = -EINVAL;
245 break;
246 } 238 }
247out: 239
248 unlock_kernel(); 240 return -EINVAL;
249 return err; 241}
242
243#ifdef CONFIG_COMPAT
244struct raw32_config_request {
245 compat_int_t raw_minor;
246 compat_u64 block_major;
247 compat_u64 block_minor;
248};
249
250static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd,
251 unsigned long arg)
252{
253 struct raw32_config_request __user *user_req = compat_ptr(arg);
254 struct raw32_config_request rq;
255 dev_t dev;
256 int err = 0;
257
258 switch (cmd) {
259 case RAW_SETBIND:
260 if (copy_from_user(&rq, user_req, sizeof(rq)))
261 return -EFAULT;
262
263 return bind_set(rq.raw_minor, rq.block_major, rq.block_minor);
264
265 case RAW_GETBIND:
266 if (copy_from_user(&rq, user_req, sizeof(rq)))
267 return -EFAULT;
268
269 err = bind_get(rq.raw_minor, &dev);
270 if (err)
271 return err;
272
273 rq.block_major = MAJOR(dev);
274 rq.block_minor = MINOR(dev);
275
276 if (copy_to_user(user_req, &rq, sizeof(rq)))
277 return -EFAULT;
278
279 return 0;
280 }
281
282 return -EINVAL;
250} 283}
284#endif
251 285
252static const struct file_operations raw_fops = { 286static const struct file_operations raw_fops = {
253 .read = do_sync_read, 287 .read = do_sync_read,
@@ -263,6 +297,9 @@ static const struct file_operations raw_fops = {
263 297
264static const struct file_operations raw_ctl_fops = { 298static const struct file_operations raw_ctl_fops = {
265 .unlocked_ioctl = raw_ctl_ioctl, 299 .unlocked_ioctl = raw_ctl_ioctl,
300#ifdef CONFIG_COMPAT
301 .compat_ioctl = raw_ctl_compat_ioctl,
302#endif
266 .open = raw_open, 303 .open = raw_open,
267 .owner = THIS_MODULE, 304 .owner = THIS_MODULE,
268}; 305};
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
index 80ea6bcfffdc..e32cbf0c9a0b 100644
--- a/drivers/char/tlclk.c
+++ b/drivers/char/tlclk.c
@@ -37,7 +37,7 @@
37#include <linux/ioport.h> 37#include <linux/ioport.h>
38#include <linux/interrupt.h> 38#include <linux/interrupt.h>
39#include <linux/spinlock.h> 39#include <linux/spinlock.h>
40#include <linux/smp_lock.h> 40#include <linux/mutex.h>
41#include <linux/timer.h> 41#include <linux/timer.h>
42#include <linux/sysfs.h> 42#include <linux/sysfs.h>
43#include <linux/device.h> 43#include <linux/device.h>
@@ -206,7 +206,7 @@ static int tlclk_open(struct inode *inode, struct file *filp)
206{ 206{
207 int result; 207 int result;
208 208
209 lock_kernel(); 209 mutex_lock(&tlclk_mutex);
210 if (test_and_set_bit(0, &useflags)) { 210 if (test_and_set_bit(0, &useflags)) {
211 result = -EBUSY; 211 result = -EBUSY;
212 /* this legacy device is always one per system and it doesn't 212 /* this legacy device is always one per system and it doesn't
@@ -229,7 +229,7 @@ static int tlclk_open(struct inode *inode, struct file *filp)
229 inb(TLCLK_REG6); /* Clear interrupt events */ 229 inb(TLCLK_REG6); /* Clear interrupt events */
230 230
231out: 231out:
232 unlock_kernel(); 232 mutex_unlock(&tlclk_mutex);
233 return result; 233 return result;
234} 234}
235 235
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 4cab0c6397e3..7af443672626 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -73,7 +73,8 @@ source "drivers/gpu/drm/radeon/Kconfig"
73 73
74config DRM_I810 74config DRM_I810
75 tristate "Intel I810" 75 tristate "Intel I810"
76 depends on DRM && AGP && AGP_INTEL 76 # BKL usage in order to avoid AB-BA deadlocks, may become BROKEN_ON_SMP
77 depends on DRM && AGP && AGP_INTEL && BKL
77 help 78 help
78 Choose this option if you have an Intel I810 graphics card. If M is 79 Choose this option if you have an Intel I810 graphics card. If M is
79 selected, the module will be called i810. AGP support is required 80 selected, the module will be called i810. AGP support is required
@@ -86,6 +87,8 @@ choice
86 87
87config DRM_I830 88config DRM_I830
88 tristate "i830 driver" 89 tristate "i830 driver"
90 # BKL usage in order to avoid AB-BA deadlocks, i830 may get removed
91 depends on BKL
89 help 92 help
90 Choose this option if you have a system that has Intel 830M, 845G, 93 Choose this option if you have a system that has Intel 830M, 845G,
91 852GM, 855GM or 865G integrated graphics. If M is selected, the 94 852GM, 855GM or 865G integrated graphics. If M is selected, the
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
diff --git a/drivers/net/appletalk/Kconfig b/drivers/net/appletalk/Kconfig
index 0a0e0cd81a23..20f97e7017ce 100644
--- a/drivers/net/appletalk/Kconfig
+++ b/drivers/net/appletalk/Kconfig
@@ -3,6 +3,7 @@
3# 3#
4config ATALK 4config ATALK
5 tristate "Appletalk protocol support" 5 tristate "Appletalk protocol support"
6 depends on BKL # waiting to be removed from net/appletalk/ddp.c
6 select LLC 7 select LLC
7 ---help--- 8 ---help---
8 AppleTalk is the protocol that Apple computers can use to communicate 9 AppleTalk is the protocol that Apple computers can use to communicate
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index 3f94edab25fa..e73ebefdf3e0 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -31,8 +31,9 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL;
31static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) 31static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
32{ 32{
33 loff_t new = -1; 33 loff_t new = -1;
34 struct inode *inode = file->f_path.dentry->d_inode;
34 35
35 lock_kernel(); 36 mutex_lock(&inode->i_mutex);
36 switch (whence) { 37 switch (whence) {
37 case 0: 38 case 0:
38 new = off; 39 new = off;
@@ -44,12 +45,12 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
44 new = 256 + off; 45 new = 256 + off;
45 break; 46 break;
46 } 47 }
47 if (new < 0 || new > 256) { 48 if (new < 0 || new > 256)
48 unlock_kernel(); 49 new = -EINVAL;
49 return -EINVAL; 50 else
50 } 51 file->f_pos = new;
51 unlock_kernel(); 52 mutex_unlock(&inode->i_mutex);
52 return (file->f_pos = new); 53 return new;
53} 54}
54 55
55static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, 56static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 8373ca0de8e0..38e6fa9a2012 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -21,7 +21,6 @@
21#include <linux/hdreg.h> 21#include <linux/hdreg.h>
22#include <linux/async.h> 22#include <linux/async.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/smp_lock.h>
25 24
26#include <asm/ccwdev.h> 25#include <asm/ccwdev.h>
27#include <asm/ebcdic.h> 26#include <asm/ebcdic.h>
@@ -2236,7 +2235,6 @@ static int dasd_open(struct block_device *bdev, fmode_t mode)
2236 if (!block) 2235 if (!block)
2237 return -ENODEV; 2236 return -ENODEV;
2238 2237
2239 lock_kernel();
2240 base = block->base; 2238 base = block->base;
2241 atomic_inc(&block->open_count); 2239 atomic_inc(&block->open_count);
2242 if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) { 2240 if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) {
@@ -2271,14 +2269,12 @@ static int dasd_open(struct block_device *bdev, fmode_t mode)
2271 goto out; 2269 goto out;
2272 } 2270 }
2273 2271
2274 unlock_kernel();
2275 return 0; 2272 return 0;
2276 2273
2277out: 2274out:
2278 module_put(base->discipline->owner); 2275 module_put(base->discipline->owner);
2279unlock: 2276unlock:
2280 atomic_dec(&block->open_count); 2277 atomic_dec(&block->open_count);
2281 unlock_kernel();
2282 return rc; 2278 return rc;
2283} 2279}
2284 2280
@@ -2286,10 +2282,8 @@ static int dasd_release(struct gendisk *disk, fmode_t mode)
2286{ 2282{
2287 struct dasd_block *block = disk->private_data; 2283 struct dasd_block *block = disk->private_data;
2288 2284
2289 lock_kernel();
2290 atomic_dec(&block->open_count); 2285 atomic_dec(&block->open_count);
2291 module_put(block->base->discipline->owner); 2286 module_put(block->base->discipline->owner);
2292 unlock_kernel();
2293 return 0; 2287 return 0;
2294} 2288}
2295 2289
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 1557214944f7..26075e95b1ba 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -16,7 +16,6 @@
16#include <linux/major.h> 16#include <linux/major.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/blkpg.h> 18#include <linux/blkpg.h>
19#include <linux/smp_lock.h>
20#include <linux/slab.h> 19#include <linux/slab.h>
21#include <asm/compat.h> 20#include <asm/compat.h>
22#include <asm/ccwdev.h> 21#include <asm/ccwdev.h>
@@ -370,9 +369,8 @@ static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd,
370 return ret; 369 return ret;
371} 370}
372 371
373static int 372int dasd_ioctl(struct block_device *bdev, fmode_t mode,
374dasd_do_ioctl(struct block_device *bdev, fmode_t mode, 373 unsigned int cmd, unsigned long arg)
375 unsigned int cmd, unsigned long arg)
376{ 374{
377 struct dasd_block *block = bdev->bd_disk->private_data; 375 struct dasd_block *block = bdev->bd_disk->private_data;
378 void __user *argp; 376 void __user *argp;
@@ -430,14 +428,3 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode,
430 return -EINVAL; 428 return -EINVAL;
431 } 429 }
432} 430}
433
434int dasd_ioctl(struct block_device *bdev, fmode_t mode,
435 unsigned int cmd, unsigned long arg)
436{
437 int rc;
438
439 lock_kernel();
440 rc = dasd_do_ioctl(bdev, mode, cmd, arg);
441 unlock_kernel();
442 return rc;
443}
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 2bd72aa34c59..9b43ae94beba 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -14,7 +14,6 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/blkdev.h> 16#include <linux/blkdev.h>
17#include <linux/smp_lock.h>
18#include <linux/completion.h> 17#include <linux/completion.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/platform_device.h> 19#include <linux/platform_device.h>
@@ -776,7 +775,6 @@ dcssblk_open(struct block_device *bdev, fmode_t mode)
776 struct dcssblk_dev_info *dev_info; 775 struct dcssblk_dev_info *dev_info;
777 int rc; 776 int rc;
778 777
779 lock_kernel();
780 dev_info = bdev->bd_disk->private_data; 778 dev_info = bdev->bd_disk->private_data;
781 if (NULL == dev_info) { 779 if (NULL == dev_info) {
782 rc = -ENODEV; 780 rc = -ENODEV;
@@ -786,7 +784,6 @@ dcssblk_open(struct block_device *bdev, fmode_t mode)
786 bdev->bd_block_size = 4096; 784 bdev->bd_block_size = 4096;
787 rc = 0; 785 rc = 0;
788out: 786out:
789 unlock_kernel();
790 return rc; 787 return rc;
791} 788}
792 789
@@ -797,7 +794,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode)
797 struct segment_info *entry; 794 struct segment_info *entry;
798 int rc; 795 int rc;
799 796
800 lock_kernel();
801 if (!dev_info) { 797 if (!dev_info) {
802 rc = -ENODEV; 798 rc = -ENODEV;
803 goto out; 799 goto out;
@@ -815,7 +811,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode)
815 up_write(&dcssblk_devices_sem); 811 up_write(&dcssblk_devices_sem);
816 rc = 0; 812 rc = 0;
817out: 813out:
818 unlock_kernel();
819 return rc; 814 return rc;
820} 815}
821 816
diff --git a/drivers/staging/cx25821/Kconfig b/drivers/staging/cx25821/Kconfig
index df7756a95fad..813cb355ac01 100644
--- a/drivers/staging/cx25821/Kconfig
+++ b/drivers/staging/cx25821/Kconfig
@@ -1,6 +1,7 @@
1config VIDEO_CX25821 1config VIDEO_CX25821
2 tristate "Conexant cx25821 support" 2 tristate "Conexant cx25821 support"
3 depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT 3 depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT
4 depends on BKL # please fix
4 select I2C_ALGOBIT 5 select I2C_ALGOBIT
5 select VIDEO_BTCX 6 select VIDEO_BTCX
6 select VIDEO_TVEEPROM 7 select VIDEO_TVEEPROM
diff --git a/drivers/staging/easycap/Kconfig b/drivers/staging/easycap/Kconfig
index bd96f39f2735..9d5fe4ddc30a 100644
--- a/drivers/staging/easycap/Kconfig
+++ b/drivers/staging/easycap/Kconfig
@@ -1,6 +1,7 @@
1config EASYCAP 1config EASYCAP
2 tristate "EasyCAP USB ID 05e1:0408 support" 2 tristate "EasyCAP USB ID 05e1:0408 support"
3 depends on USB && VIDEO_DEV 3 depends on USB && VIDEO_DEV
4 depends on BKL # please fix
4 5
5 ---help--- 6 ---help---
6 This is an integrated audio/video driver for EasyCAP cards with 7 This is an integrated audio/video driver for EasyCAP cards with
diff --git a/drivers/staging/go7007/Kconfig b/drivers/staging/go7007/Kconfig
index e47f683a323e..75fa46805527 100644
--- a/drivers/staging/go7007/Kconfig
+++ b/drivers/staging/go7007/Kconfig
@@ -1,6 +1,7 @@
1config VIDEO_GO7007 1config VIDEO_GO7007
2 tristate "WIS GO7007 MPEG encoder support" 2 tristate "WIS GO7007 MPEG encoder support"
3 depends on VIDEO_DEV && PCI && I2C && INPUT 3 depends on VIDEO_DEV && PCI && I2C && INPUT
4 depends on BKL # please fix
4 depends on SND 5 depends on SND
5 select VIDEOBUF_DMA_SG 6 select VIDEOBUF_DMA_SG
6 select VIDEO_IR 7 select VIDEO_IR
diff --git a/drivers/staging/usbip/Kconfig b/drivers/staging/usbip/Kconfig
index 2c1d10acb8b5..b11ec379b5c2 100644
--- a/drivers/staging/usbip/Kconfig
+++ b/drivers/staging/usbip/Kconfig
@@ -1,6 +1,6 @@
1config USB_IP_COMMON 1config USB_IP_COMMON
2 tristate "USB IP support (EXPERIMENTAL)" 2 tristate "USB IP support (EXPERIMENTAL)"
3 depends on USB && NET && EXPERIMENTAL 3 depends on USB && NET && EXPERIMENTAL && BKL
4 default N 4 default N
5 ---help--- 5 ---help---
6 This enables pushing USB packets over IP to allow remote 6 This enables pushing USB packets over IP to allow remote