Skip to content

Commit 5704e44

Browse files
committed
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
2 parents 9115124 + 6de5bd1 commit 5704e44

File tree

53 files changed

+347
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+347
-402
lines changed

arch/cris/arch-v10/drivers/ds1302.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <linux/module.h>
2020
#include <linux/miscdevice.h>
2121
#include <linux/delay.h>
22-
#include <linux/smp_lock.h>
22+
#include <linux/mutex.h>
2323
#include <linux/bcd.h>
2424
#include <linux/capability.h>
2525

@@ -34,6 +34,7 @@
3434

3535
#define RTC_MAJOR_NR 121 /* local major, change later */
3636

37+
static DEFINE_MUTEX(ds1302_mutex);
3738
static const char ds1302_name[] = "ds1302";
3839

3940
/* 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
357358
{
358359
int ret;
359360

360-
lock_kernel();
361+
mutex_lock(&ds1302_mutex);
361362
ret = rtc_ioctl(file, cmd, arg);
362-
unlock_kernel();
363+
mutex_unlock(&ds1302_mutex);
363364

364365
return ret;
365366
}

arch/cris/arch-v10/drivers/pcf8563.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <linux/delay.h>
2828
#include <linux/bcd.h>
2929
#include <linux/mutex.h>
30-
#include <linux/smp_lock.h>
3130

3231
#include <asm/uaccess.h>
3332
#include <asm/system.h>
@@ -49,6 +48,7 @@
4948
#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
5049
#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
5150

51+
static DEFINE_MUTEX(pcf8563_mutex);
5252
static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
5353

5454
static const unsigned char days_in_month[] =
@@ -343,9 +343,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
343343
{
344344
int ret;
345345

346-
lock_kernel();
346+
mutex_lock(&pcf8563_mutex);
347347
return pcf8563_ioctl(filp, cmd, arg);
348-
unlock_kernel();
348+
mutex_unlock(&pcf8563_mutex);
349349

350350
return ret;
351351
}

arch/cris/arch-v10/drivers/sync_serial.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <linux/interrupt.h>
2121
#include <linux/poll.h>
2222
#include <linux/init.h>
23-
#include <linux/smp_lock.h>
23+
#include <linux/mutex.h>
2424
#include <linux/timer.h>
2525
#include <asm/irq.h>
2626
#include <asm/dma.h>
@@ -149,6 +149,7 @@ struct sync_port {
149149
};
150150

151151

152+
static DEFINE_MUTEX(sync_serial_mutex);
152153
static int etrax_sync_serial_init(void);
153154
static void initialize_port(int portnbr);
154155
static inline int sync_data_avail(struct sync_port *port);
@@ -445,7 +446,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
445446
int mode;
446447
int err = -EBUSY;
447448

448-
lock_kernel();
449+
mutex_lock(&sync_serial_mutex);
449450
DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
450451

451452
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)
626627
ret = 0;
627628

628629
out:
629-
unlock_kernel();
630+
mutex_unlock(&sync_serial_mutex);
630631
return ret;
631632
}
632633

@@ -961,9 +962,9 @@ static long sync_serial_ioctl(struct file *file,
961962
{
962963
long ret;
963964

964-
lock_kernel();
965+
mutex_lock(&sync_serial_mutex);
965966
ret = sync_serial_ioctl_unlocked(file, cmd, arg);
966-
unlock_kernel();
967+
mutex_unlock(&sync_serial_mutex);
967968

968969
return ret;
969970
}

arch/cris/arch-v32/drivers/cryptocop.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3139,9 +3139,9 @@ cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
31393139
struct inode *inode = file->f_path.dentry->d_inode;
31403140
long ret;
31413141

3142-
lock_kernel();
3142+
mutex_lock(&cryptocop_mutex);
31433143
ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg);
3144-
unlock_kernel();
3144+
mutex_unlock(&cryptocop_mutex);
31453145

31463146
return ret;
31473147
}

arch/cris/arch-v32/drivers/mach-a3/gpio.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <linux/init.h>
2424
#include <linux/interrupt.h>
2525
#include <linux/spinlock.h>
26-
#include <linux/smp_lock.h>
26+
#include <linux/mutex.h>
2727

2828
#include <asm/etraxgpio.h>
2929
#include <hwregs/reg_map.h>
@@ -66,6 +66,7 @@ static int dp_cnt;
6666
#define DP(x)
6767
#endif
6868

69+
static DEFINE_MUTEX(gpio_mutex);
6970
static char gpio_name[] = "etrax gpio";
7071

7172
#ifdef CONFIG_ETRAX_VIRTUAL_GPIO
@@ -391,7 +392,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
391392
if (!priv)
392393
return -ENOMEM;
393394

394-
lock_kernel();
395+
mutex_lock(&gpio_mutex);
395396
memset(priv, 0, sizeof(*priv));
396397

397398
priv->minor = p;
@@ -414,7 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
414415
spin_unlock_irq(&gpio_lock);
415416
}
416417

417-
unlock_kernel();
418+
mutex_unlock(&gpio_mutex);
418419
return 0;
419420
}
420421

@@ -667,9 +668,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
667668
{
668669
long ret;
669670

670-
lock_kernel();
671+
mutex_lock(&gpio_mutex);
671672
ret = gpio_ioctl_unlocked(file, cmd, arg);
672-
unlock_kernel();
673+
mutex_unlock(&gpio_mutex);
673674

674675
return ret;
675676
}

arch/cris/arch-v32/drivers/mach-fs/gpio.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <linux/init.h>
2323
#include <linux/interrupt.h>
2424
#include <linux/spinlock.h>
25-
#include <linux/smp_lock.h>
25+
#include <linux/mutex.h>
2626

2727
#include <asm/etraxgpio.h>
2828
#include <hwregs/reg_map.h>
@@ -64,6 +64,7 @@ static int dp_cnt;
6464
#define DP(x)
6565
#endif
6666

67+
static DEFINE_MUTEX(gpio_mutex);
6768
static char gpio_name[] = "etrax gpio";
6869

6970
#if 0
@@ -429,7 +430,7 @@ gpio_open(struct inode *inode, struct file *filp)
429430
if (!priv)
430431
return -ENOMEM;
431432

432-
lock_kernel();
433+
mutex_lock(&gpio_mutex);
433434
memset(priv, 0, sizeof(*priv));
434435

435436
priv->minor = p;
@@ -450,7 +451,7 @@ gpio_open(struct inode *inode, struct file *filp)
450451
alarmlist = priv;
451452
spin_unlock_irq(&alarm_lock);
452453

453-
unlock_kernel();
454+
mutex_unlock(&gpio_mutex);
454455
return 0;
455456
}
456457

@@ -708,9 +709,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
708709
{
709710
long ret;
710711

711-
lock_kernel();
712+
mutex_lock(&gpio_mutex);
712713
ret = gpio_ioctl_unlocked(file, cmd, arg);
713-
unlock_kernel();
714+
mutex_unlock(&gpio_mutex);
714715

715716
return ret;
716717
}

arch/cris/arch-v32/drivers/pcf8563.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <linux/init.h>
2525
#include <linux/fs.h>
2626
#include <linux/ioctl.h>
27-
#include <linux/smp_lock.h>
2827
#include <linux/delay.h>
2928
#include <linux/bcd.h>
3029
#include <linux/mutex.h>
@@ -45,6 +44,7 @@
4544
#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
4645
#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
4746

47+
static DEFINE_MUTEX(pcf8563_mutex);
4848
static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
4949

5050
static const unsigned char days_in_month[] =
@@ -339,9 +339,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
339339
{
340340
int ret;
341341

342-
lock_kernel();
342+
mutex_lock(&pcf8563_mutex);
343343
return pcf8563_ioctl(filp, cmd, arg);
344-
unlock_kernel();
344+
mutex_unlock(&pcf8563_mutex);
345345

346346
return ret;
347347
}

arch/cris/arch-v32/drivers/sync_serial.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <linux/errno.h>
1414
#include <linux/major.h>
1515
#include <linux/sched.h>
16-
#include <linux/smp_lock.h>
16+
#include <linux/mutex.h>
1717
#include <linux/interrupt.h>
1818
#include <linux/poll.h>
1919
#include <linux/init.h>
@@ -145,6 +145,7 @@ typedef struct sync_port
145145
spinlock_t lock;
146146
} sync_port;
147147

148+
static DEFINE_MUTEX(sync_serial_mutex);
148149
static int etrax_sync_serial_init(void);
149150
static void initialize_port(int portnbr);
150151
static inline int sync_data_avail(struct sync_port *port);
@@ -434,7 +435,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
434435
reg_dma_rw_cfg cfg = {.en = regk_dma_yes};
435436
reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes};
436437

437-
lock_kernel();
438+
mutex_lock(&sync_serial_mutex);
438439
DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
439440

440441
if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled)
@@ -583,7 +584,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
583584
port->busy++;
584585
ret = 0;
585586
out:
586-
unlock_kernel();
587+
mutex_unlock(&sync_serial_mutex);
587588
return ret;
588589
}
589590

@@ -966,9 +967,9 @@ static long sync_serial_ioctl(struct file *file,
966967
{
967968
long ret;
968969

969-
lock_kernel();
970+
mutex_lock(&sync_serial_mutex);
970971
ret = sync_serial_ioctl_unlocked(file, cmd, arg);
971-
unlock_kernel();
972+
mutex_unlock(&sync_serial_mutex);
972973

973974
return ret;
974975
}

arch/parisc/kernel/perf.c

-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#include <linux/init.h>
4747
#include <linux/proc_fs.h>
4848
#include <linux/miscdevice.h>
49-
#include <linux/smp_lock.h>
5049
#include <linux/spinlock.h>
5150

5251
#include <asm/uaccess.h>
@@ -261,16 +260,13 @@ printk("Preparing to start counters\n");
261260
*/
262261
static int perf_open(struct inode *inode, struct file *file)
263262
{
264-
lock_kernel();
265263
spin_lock(&perf_lock);
266264
if (perf_enabled) {
267265
spin_unlock(&perf_lock);
268-
unlock_kernel();
269266
return -EBUSY;
270267
}
271268
perf_enabled = 1;
272269
spin_unlock(&perf_lock);
273-
unlock_kernel();
274270

275271
return 0;
276272
}

arch/um/drivers/harddog_kern.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@
4242
#include <linux/miscdevice.h>
4343
#include <linux/watchdog.h>
4444
#include <linux/reboot.h>
45-
#include <linux/smp_lock.h>
45+
#include <linux/mutex.h>
4646
#include <linux/init.h>
4747
#include <linux/spinlock.h>
4848
#include <asm/uaccess.h>
4949
#include "mconsole.h"
5050

5151
MODULE_LICENSE("GPL");
5252

53+
static DEFINE_MUTEX(harddog_mutex);
5354
static DEFINE_SPINLOCK(lock);
5455
static int timer_alive;
5556
static int harddog_in_fd = -1;
@@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file)
6667
int err = -EBUSY;
6768
char *sock = NULL;
6869

69-
lock_kernel();
70+
mutex_lock(&harddog_mutex);
7071
spin_lock(&lock);
7172
if(timer_alive)
7273
goto err;
@@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file)
8384

8485
timer_alive = 1;
8586
spin_unlock(&lock);
86-
unlock_kernel();
87+
mutex_unlock(&harddog_mutex);
8788
return nonseekable_open(inode, file);
8889
err:
8990
spin_unlock(&lock);
90-
unlock_kernel();
91+
mutex_unlock(&harddog_mutex);
9192
return err;
9293
}
9394

@@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file,
153154
{
154155
long ret;
155156

156-
lock_kernel();
157+
mutex_lock(&harddog_mutex);
157158
ret = harddog_ioctl_unlocked(file, cmd, arg);
158-
unlock_kernel();
159+
mutex_unlock(&harddog_mutex);
159160

160161
return ret;
161162
}

0 commit comments

Comments
 (0)