aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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 /arch
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 'arch')
-rw-r--r--arch/cris/arch-v10/drivers/ds1302.c7
-rw-r--r--arch/cris/arch-v10/drivers/pcf8563.c6
-rw-r--r--arch/cris/arch-v10/drivers/sync_serial.c11
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c4
-rw-r--r--arch/cris/arch-v32/drivers/mach-a3/gpio.c11
-rw-r--r--arch/cris/arch-v32/drivers/mach-fs/gpio.c11
-rw-r--r--arch/cris/arch-v32/drivers/pcf8563.c6
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c11
-rw-r--r--arch/parisc/kernel/perf.c4
-rw-r--r--arch/um/drivers/harddog_kern.c13
-rw-r--r--arch/um/drivers/hostaudio_kern.c12
-rw-r--r--arch/um/drivers/ubd_kern.c11
-rw-r--r--arch/um/kernel/exec.c2
13 files changed, 56 insertions, 53 deletions
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
index 884275629ef7..4b92ad08b0ff 100644
--- a/arch/cris/arch-v10/drivers/ds1302.c
+++ b/arch/cris/arch-v10/drivers/ds1302.c
@@ -19,7 +19,7 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/miscdevice.h> 20#include <linux/miscdevice.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/smp_lock.h> 22#include <linux/mutex.h>
23#include <linux/bcd.h> 23#include <linux/bcd.h>
24#include <linux/capability.h> 24#include <linux/capability.h>
25 25
@@ -34,6 +34,7 @@
34 34
35#define RTC_MAJOR_NR 121 /* local major, change later */ 35#define RTC_MAJOR_NR 121 /* local major, change later */
36 36
37static DEFINE_MUTEX(ds1302_mutex);
37static const char ds1302_name[] = "ds1302"; 38static const char ds1302_name[] = "ds1302";
38 39
39/* The DS1302 might be connected to different bits on different products. 40/* The DS1302 might be connected to different bits on different products.
@@ -357,9 +358,9 @@ static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned lon
357{ 358{
358 int ret; 359 int ret;
359 360
360 lock_kernel(); 361 mutex_lock(&ds1302_mutex);
361 ret = rtc_ioctl(file, cmd, arg); 362 ret = rtc_ioctl(file, cmd, arg);
362 unlock_kernel(); 363 mutex_unlock(&ds1302_mutex);
363 364
364 return ret; 365 return ret;
365} 366}
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c
index 7dcb1f85f42b..2f1ddedca2bd 100644
--- a/arch/cris/arch-v10/drivers/pcf8563.c
+++ b/arch/cris/arch-v10/drivers/pcf8563.c
@@ -27,7 +27,6 @@
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/bcd.h> 28#include <linux/bcd.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/smp_lock.h>
31 30
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
33#include <asm/system.h> 32#include <asm/system.h>
@@ -49,6 +48,7 @@
49#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) 48#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
50#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) 49#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
51 50
51static DEFINE_MUTEX(pcf8563_mutex);
52static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ 52static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
53 53
54static const unsigned char days_in_month[] = 54static const unsigned char days_in_month[] =
@@ -343,9 +343,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
343{ 343{
344 int ret; 344 int ret;
345 345
346 lock_kernel(); 346 mutex_lock(&pcf8563_mutex);
347 return pcf8563_ioctl(filp, cmd, arg); 347 return pcf8563_ioctl(filp, cmd, arg);
348 unlock_kernel(); 348 mutex_unlock(&pcf8563_mutex);
349 349
350 return ret; 350 return ret;
351} 351}
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c
index ee2dd4323daf..3d9fa074a941 100644
--- a/arch/cris/arch-v10/drivers/sync_serial.c
+++ b/arch/cris/arch-v10/drivers/sync_serial.c
@@ -20,7 +20,7 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/poll.h> 21#include <linux/poll.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/smp_lock.h> 23#include <linux/mutex.h>
24#include <linux/timer.h> 24#include <linux/timer.h>
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <asm/dma.h> 26#include <asm/dma.h>
@@ -149,6 +149,7 @@ struct sync_port {
149}; 149};
150 150
151 151
152static DEFINE_MUTEX(sync_serial_mutex);
152static int etrax_sync_serial_init(void); 153static int etrax_sync_serial_init(void);
153static void initialize_port(int portnbr); 154static void initialize_port(int portnbr);
154static inline int sync_data_avail(struct sync_port *port); 155static inline int sync_data_avail(struct sync_port *port);
@@ -445,7 +446,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
445 int mode; 446 int mode;
446 int err = -EBUSY; 447 int err = -EBUSY;
447 448
448 lock_kernel(); 449 mutex_lock(&sync_serial_mutex);
449 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); 450 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
450 451
451 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { 452 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
@@ -626,7 +627,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
626 ret = 0; 627 ret = 0;
627 628
628out: 629out:
629 unlock_kernel(); 630 mutex_unlock(&sync_serial_mutex);
630 return ret; 631 return ret;
631} 632}
632 633
@@ -961,9 +962,9 @@ static long sync_serial_ioctl(struct file *file,
961{ 962{
962 long ret; 963 long ret;
963 964
964 lock_kernel(); 965 mutex_lock(&sync_serial_mutex);
965 ret = sync_serial_ioctl_unlocked(file, cmd, arg); 966 ret = sync_serial_ioctl_unlocked(file, cmd, arg);
966 unlock_kernel(); 967 mutex_unlock(&sync_serial_mutex);
967 968
968 return ret; 969 return ret;
969} 970}
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index b07646a30509..0973d5a2780f 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -3139,9 +3139,9 @@ cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
3139 struct inode *inode = file->f_path.dentry->d_inode; 3139 struct inode *inode = file->f_path.dentry->d_inode;
3140 long ret; 3140 long ret;
3141 3141
3142 lock_kernel(); 3142 mutex_lock(&cryptocop_mutex);
3143 ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); 3143 ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg);
3144 unlock_kernel(); 3144 mutex_unlock(&cryptocop_mutex);
3145 3145
3146 return ret; 3146 return ret;
3147} 3147}
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
index 2dcd27adbad4..50d1885c4794 100644
--- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c
+++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c
@@ -23,7 +23,7 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <linux/smp_lock.h> 26#include <linux/mutex.h>
27 27
28#include <asm/etraxgpio.h> 28#include <asm/etraxgpio.h>
29#include <hwregs/reg_map.h> 29#include <hwregs/reg_map.h>
@@ -66,6 +66,7 @@ static int dp_cnt;
66#define DP(x) 66#define DP(x)
67#endif 67#endif
68 68
69static DEFINE_MUTEX(gpio_mutex);
69static char gpio_name[] = "etrax gpio"; 70static char gpio_name[] = "etrax gpio";
70 71
71#ifdef CONFIG_ETRAX_VIRTUAL_GPIO 72#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
@@ -391,7 +392,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
391 if (!priv) 392 if (!priv)
392 return -ENOMEM; 393 return -ENOMEM;
393 394
394 lock_kernel(); 395 mutex_lock(&gpio_mutex);
395 memset(priv, 0, sizeof(*priv)); 396 memset(priv, 0, sizeof(*priv));
396 397
397 priv->minor = p; 398 priv->minor = p;
@@ -414,7 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
414 spin_unlock_irq(&gpio_lock); 415 spin_unlock_irq(&gpio_lock);
415 } 416 }
416 417
417 unlock_kernel(); 418 mutex_unlock(&gpio_mutex);
418 return 0; 419 return 0;
419} 420}
420 421
@@ -667,9 +668,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
667{ 668{
668 long ret; 669 long ret;
669 670
670 lock_kernel(); 671 mutex_lock(&gpio_mutex);
671 ret = gpio_ioctl_unlocked(file, cmd, arg); 672 ret = gpio_ioctl_unlocked(file, cmd, arg);
672 unlock_kernel(); 673 mutex_unlock(&gpio_mutex);
673 674
674 return ret; 675 return ret;
675} 676}
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
index 5ec8a7d4e7d7..de8dca0550f2 100644
--- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c
+++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
@@ -22,7 +22,7 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/smp_lock.h> 25#include <linux/mutex.h>
26 26
27#include <asm/etraxgpio.h> 27#include <asm/etraxgpio.h>
28#include <hwregs/reg_map.h> 28#include <hwregs/reg_map.h>
@@ -64,6 +64,7 @@ static int dp_cnt;
64#define DP(x) 64#define DP(x)
65#endif 65#endif
66 66
67static DEFINE_MUTEX(gpio_mutex);
67static char gpio_name[] = "etrax gpio"; 68static char gpio_name[] = "etrax gpio";
68 69
69#if 0 70#if 0
@@ -429,7 +430,7 @@ gpio_open(struct inode *inode, struct file *filp)
429 if (!priv) 430 if (!priv)
430 return -ENOMEM; 431 return -ENOMEM;
431 432
432 lock_kernel(); 433 mutex_lock(&gpio_mutex);
433 memset(priv, 0, sizeof(*priv)); 434 memset(priv, 0, sizeof(*priv));
434 435
435 priv->minor = p; 436 priv->minor = p;
@@ -450,7 +451,7 @@ gpio_open(struct inode *inode, struct file *filp)
450 alarmlist = priv; 451 alarmlist = priv;
451 spin_unlock_irq(&alarm_lock); 452 spin_unlock_irq(&alarm_lock);
452 453
453 unlock_kernel(); 454 mutex_unlock(&gpio_mutex);
454 return 0; 455 return 0;
455} 456}
456 457
@@ -708,9 +709,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
708{ 709{
709 long ret; 710 long ret;
710 711
711 lock_kernel(); 712 mutex_lock(&gpio_mutex);
712 ret = gpio_ioctl_unlocked(file, cmd, arg); 713 ret = gpio_ioctl_unlocked(file, cmd, arg);
713 unlock_kernel(); 714 mutex_unlock(&gpio_mutex);
714 715
715 return ret; 716 return ret;
716} 717}
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c
index bef6eb53b153..bdcac9dec5cb 100644
--- a/arch/cris/arch-v32/drivers/pcf8563.c
+++ b/arch/cris/arch-v32/drivers/pcf8563.c
@@ -24,7 +24,6 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/fs.h> 25#include <linux/fs.h>
26#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27#include <linux/smp_lock.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
29#include <linux/bcd.h> 28#include <linux/bcd.h>
30#include <linux/mutex.h> 29#include <linux/mutex.h>
@@ -45,6 +44,7 @@
45#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) 44#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
46#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) 45#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
47 46
47static DEFINE_MUTEX(pcf8563_mutex);
48static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ 48static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
49 49
50static const unsigned char days_in_month[] = 50static const unsigned char days_in_month[] =
@@ -339,9 +339,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
339{ 339{
340 int ret; 340 int ret;
341 341
342 lock_kernel(); 342 mutex_lock(&pcf8563_mutex);
343 return pcf8563_ioctl(filp, cmd, arg); 343 return pcf8563_ioctl(filp, cmd, arg);
344 unlock_kernel(); 344 mutex_unlock(&pcf8563_mutex);
345 345
346 return ret; 346 return ret;
347} 347}
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index ca248f3adb80..a01ae9f3b814 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -13,7 +13,7 @@
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/major.h> 14#include <linux/major.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/smp_lock.h> 16#include <linux/mutex.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/poll.h> 18#include <linux/poll.h>
19#include <linux/init.h> 19#include <linux/init.h>
@@ -145,6 +145,7 @@ typedef struct sync_port
145 spinlock_t lock; 145 spinlock_t lock;
146} sync_port; 146} sync_port;
147 147
148static DEFINE_MUTEX(sync_serial_mutex);
148static int etrax_sync_serial_init(void); 149static int etrax_sync_serial_init(void);
149static void initialize_port(int portnbr); 150static void initialize_port(int portnbr);
150static inline int sync_data_avail(struct sync_port *port); 151static inline int sync_data_avail(struct sync_port *port);
@@ -434,7 +435,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
434 reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; 435 reg_dma_rw_cfg cfg = {.en = regk_dma_yes};
435 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; 436 reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes};
436 437
437 lock_kernel(); 438 mutex_lock(&sync_serial_mutex);
438 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); 439 DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
439 440
440 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) 441 if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled)
@@ -583,7 +584,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
583 port->busy++; 584 port->busy++;
584 ret = 0; 585 ret = 0;
585out: 586out:
586 unlock_kernel(); 587 mutex_unlock(&sync_serial_mutex);
587 return ret; 588 return ret;
588} 589}
589 590
@@ -966,9 +967,9 @@ static long sync_serial_ioctl(struct file *file,
966{ 967{
967 long ret; 968 long ret;
968 969
969 lock_kernel(); 970 mutex_lock(&sync_serial_mutex);
970 ret = sync_serial_ioctl_unlocked(file, cmd, arg); 971 ret = sync_serial_ioctl_unlocked(file, cmd, arg);
971 unlock_kernel(); 972 mutex_unlock(&sync_serial_mutex);
972 973
973 return ret; 974 return ret;
974} 975}
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index f9f6783e4bdd..ba0c053e25ae 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -46,7 +46,6 @@
46#include <linux/init.h> 46#include <linux/init.h>
47#include <linux/proc_fs.h> 47#include <linux/proc_fs.h>
48#include <linux/miscdevice.h> 48#include <linux/miscdevice.h>
49#include <linux/smp_lock.h>
50#include <linux/spinlock.h> 49#include <linux/spinlock.h>
51 50
52#include <asm/uaccess.h> 51#include <asm/uaccess.h>
@@ -261,16 +260,13 @@ printk("Preparing to start counters\n");
261 */ 260 */
262static int perf_open(struct inode *inode, struct file *file) 261static int perf_open(struct inode *inode, struct file *file)
263{ 262{
264 lock_kernel();
265 spin_lock(&perf_lock); 263 spin_lock(&perf_lock);
266 if (perf_enabled) { 264 if (perf_enabled) {
267 spin_unlock(&perf_lock); 265 spin_unlock(&perf_lock);
268 unlock_kernel();
269 return -EBUSY; 266 return -EBUSY;
270 } 267 }
271 perf_enabled = 1; 268 perf_enabled = 1;
272 spin_unlock(&perf_lock); 269 spin_unlock(&perf_lock);
273 unlock_kernel();
274 270
275 return 0; 271 return 0;
276} 272}
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c
index cfcac1ff4cf2..86036276020f 100644
--- a/arch/um/drivers/harddog_kern.c
+++ b/arch/um/drivers/harddog_kern.c
@@ -42,7 +42,7 @@
42#include <linux/miscdevice.h> 42#include <linux/miscdevice.h>
43#include <linux/watchdog.h> 43#include <linux/watchdog.h>
44#include <linux/reboot.h> 44#include <linux/reboot.h>
45#include <linux/smp_lock.h> 45#include <linux/mutex.h>
46#include <linux/init.h> 46#include <linux/init.h>
47#include <linux/spinlock.h> 47#include <linux/spinlock.h>
48#include <asm/uaccess.h> 48#include <asm/uaccess.h>
@@ -50,6 +50,7 @@
50 50
51MODULE_LICENSE("GPL"); 51MODULE_LICENSE("GPL");
52 52
53static DEFINE_MUTEX(harddog_mutex);
53static DEFINE_SPINLOCK(lock); 54static DEFINE_SPINLOCK(lock);
54static int timer_alive; 55static int timer_alive;
55static int harddog_in_fd = -1; 56static int harddog_in_fd = -1;
@@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file)
66 int err = -EBUSY; 67 int err = -EBUSY;
67 char *sock = NULL; 68 char *sock = NULL;
68 69
69 lock_kernel(); 70 mutex_lock(&harddog_mutex);
70 spin_lock(&lock); 71 spin_lock(&lock);
71 if(timer_alive) 72 if(timer_alive)
72 goto err; 73 goto err;
@@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file)
83 84
84 timer_alive = 1; 85 timer_alive = 1;
85 spin_unlock(&lock); 86 spin_unlock(&lock);
86 unlock_kernel(); 87 mutex_unlock(&harddog_mutex);
87 return nonseekable_open(inode, file); 88 return nonseekable_open(inode, file);
88err: 89err:
89 spin_unlock(&lock); 90 spin_unlock(&lock);
90 unlock_kernel(); 91 mutex_unlock(&harddog_mutex);
91 return err; 92 return err;
92} 93}
93 94
@@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file,
153{ 154{
154 long ret; 155 long ret;
155 156
156 lock_kernel(); 157 mutex_lock(&harddog_mutex);
157 ret = harddog_ioctl_unlocked(file, cmd, arg); 158 ret = harddog_ioctl_unlocked(file, cmd, arg);
158 unlock_kernel(); 159 mutex_unlock(&harddog_mutex);
159 160
160 return ret; 161 return ret;
161} 162}
diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c
index 63c740a85b4c..f9f6a4e20590 100644
--- a/arch/um/drivers/hostaudio_kern.c
+++ b/arch/um/drivers/hostaudio_kern.c
@@ -8,7 +8,7 @@
8#include "linux/slab.h" 8#include "linux/slab.h"
9#include "linux/sound.h" 9#include "linux/sound.h"
10#include "linux/soundcard.h" 10#include "linux/soundcard.h"
11#include "linux/smp_lock.h" 11#include "linux/mutex.h"
12#include "asm/uaccess.h" 12#include "asm/uaccess.h"
13#include "init.h" 13#include "init.h"
14#include "os.h" 14#include "os.h"
@@ -63,6 +63,8 @@ static int set_mixer(char *name, int *add)
63__uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP); 63__uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP);
64#endif 64#endif
65 65
66static DEFINE_MUTEX(hostaudio_mutex);
67
66/* /dev/dsp file operations */ 68/* /dev/dsp file operations */
67 69
68static ssize_t hostaudio_read(struct file *file, char __user *buffer, 70static ssize_t hostaudio_read(struct file *file, char __user *buffer,
@@ -198,9 +200,9 @@ static int hostaudio_open(struct inode *inode, struct file *file)
198 w = 1; 200 w = 1;
199 201
200 kparam_block_sysfs_write(dsp); 202 kparam_block_sysfs_write(dsp);
201 lock_kernel(); 203 mutex_lock(&hostaudio_mutex);
202 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); 204 ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
203 unlock_kernel(); 205 mutex_unlock(&hostaudio_mutex);
204 kparam_unblock_sysfs_write(dsp); 206 kparam_unblock_sysfs_write(dsp);
205 207
206 if (ret < 0) { 208 if (ret < 0) {
@@ -259,9 +261,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)
259 w = 1; 261 w = 1;
260 262
261 kparam_block_sysfs_write(mixer); 263 kparam_block_sysfs_write(mixer);
262 lock_kernel(); 264 mutex_lock(&hostaudio_mutex);
263 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); 265 ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
264 unlock_kernel(); 266 mutex_unlock(&hostaudio_mutex);
265 kparam_unblock_sysfs_write(mixer); 267 kparam_unblock_sysfs_write(mixer);
266 268
267 if (ret < 0) { 269 if (ret < 0) {
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 9734994cba1e..ba4a98ba39c0 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -33,7 +33,7 @@
33#include "linux/mm.h" 33#include "linux/mm.h"
34#include "linux/slab.h" 34#include "linux/slab.h"
35#include "linux/vmalloc.h" 35#include "linux/vmalloc.h"
36#include "linux/smp_lock.h" 36#include "linux/mutex.h"
37#include "linux/blkpg.h" 37#include "linux/blkpg.h"
38#include "linux/genhd.h" 38#include "linux/genhd.h"
39#include "linux/spinlock.h" 39#include "linux/spinlock.h"
@@ -100,6 +100,7 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)
100#define DRIVER_NAME "uml-blkdev" 100#define DRIVER_NAME "uml-blkdev"
101 101
102static DEFINE_MUTEX(ubd_lock); 102static DEFINE_MUTEX(ubd_lock);
103static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */
103 104
104static int ubd_open(struct block_device *bdev, fmode_t mode); 105static int ubd_open(struct block_device *bdev, fmode_t mode);
105static int ubd_release(struct gendisk *disk, fmode_t mode); 106static int ubd_release(struct gendisk *disk, fmode_t mode);
@@ -1101,7 +1102,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
1101 struct ubd *ubd_dev = disk->private_data; 1102 struct ubd *ubd_dev = disk->private_data;
1102 int err = 0; 1103 int err = 0;
1103 1104
1104 lock_kernel(); 1105 mutex_lock(&ubd_mutex);
1105 if(ubd_dev->count == 0){ 1106 if(ubd_dev->count == 0){
1106 err = ubd_open_dev(ubd_dev); 1107 err = ubd_open_dev(ubd_dev);
1107 if(err){ 1108 if(err){
@@ -1120,7 +1121,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
1120 err = -EROFS; 1121 err = -EROFS;
1121 }*/ 1122 }*/
1122out: 1123out:
1123 unlock_kernel(); 1124 mutex_unlock(&ubd_mutex);
1124 return err; 1125 return err;
1125} 1126}
1126 1127
@@ -1128,10 +1129,10 @@ static int ubd_release(struct gendisk *disk, fmode_t mode)
1128{ 1129{
1129 struct ubd *ubd_dev = disk->private_data; 1130 struct ubd *ubd_dev = disk->private_data;
1130 1131
1131 lock_kernel(); 1132 mutex_lock(&ubd_mutex);
1132 if(--ubd_dev->count == 0) 1133 if(--ubd_dev->count == 0)
1133 ubd_close_dev(ubd_dev); 1134 ubd_close_dev(ubd_dev);
1134 unlock_kernel(); 1135 mutex_unlock(&ubd_mutex);
1135 return 0; 1136 return 0;
1136} 1137}
1137 1138
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c
index 49b5e1eb3262..340268be00b5 100644
--- a/arch/um/kernel/exec.c
+++ b/arch/um/kernel/exec.c
@@ -78,13 +78,11 @@ long sys_execve(const char __user *file, const char __user *const __user *argv,
78 long error; 78 long error;
79 char *filename; 79 char *filename;
80 80
81 lock_kernel();
82 filename = getname(file); 81 filename = getname(file);
83 error = PTR_ERR(filename); 82 error = PTR_ERR(filename);
84 if (IS_ERR(filename)) goto out; 83 if (IS_ERR(filename)) goto out;
85 error = execve1(filename, argv, env); 84 error = execve1(filename, argv, env);
86 putname(filename); 85 putname(filename);
87 out: 86 out:
88 unlock_kernel();
89 return error; 87 return error;
90} 88}