Commit 5704e44d authored by Linus Torvalds's avatar Linus Torvalds

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
parents 91151240 6de5bd12
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/capability.h> #include <linux/capability.h>
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define RTC_MAJOR_NR 121 /* local major, change later */ #define RTC_MAJOR_NR 121 /* local major, change later */
static DEFINE_MUTEX(ds1302_mutex);
static const char ds1302_name[] = "ds1302"; static const char ds1302_name[] = "ds1302";
/* The DS1302 might be connected to different bits on different products. /* 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,9 +358,9 @@ static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned lon
{ {
int ret; int ret;
lock_kernel(); mutex_lock(&ds1302_mutex);
ret = rtc_ioctl(file, cmd, arg); ret = rtc_ioctl(file, cmd, arg);
unlock_kernel(); mutex_unlock(&ds1302_mutex);
return ret; return ret;
} }
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -49,6 +48,7 @@ ...@@ -49,6 +48,7 @@
#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
static DEFINE_MUTEX(pcf8563_mutex);
static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
static const unsigned char days_in_month[] = static const unsigned char days_in_month[] =
...@@ -343,9 +343,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned ...@@ -343,9 +343,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
{ {
int ret; int ret;
lock_kernel(); mutex_lock(&pcf8563_mutex);
return pcf8563_ioctl(filp, cmd, arg); return pcf8563_ioctl(filp, cmd, arg);
unlock_kernel(); mutex_unlock(&pcf8563_mutex);
return ret; return ret;
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/dma.h> #include <asm/dma.h>
...@@ -149,6 +149,7 @@ struct sync_port { ...@@ -149,6 +149,7 @@ struct sync_port {
}; };
static DEFINE_MUTEX(sync_serial_mutex);
static int etrax_sync_serial_init(void); static int etrax_sync_serial_init(void);
static void initialize_port(int portnbr); static void initialize_port(int portnbr);
static inline int sync_data_avail(struct sync_port *port); 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) ...@@ -445,7 +446,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
int mode; int mode;
int err = -EBUSY; int err = -EBUSY;
lock_kernel(); mutex_lock(&sync_serial_mutex);
DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { 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,7 +627,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
ret = 0; ret = 0;
out: out:
unlock_kernel(); mutex_unlock(&sync_serial_mutex);
return ret; return ret;
} }
...@@ -961,9 +962,9 @@ static long sync_serial_ioctl(struct file *file, ...@@ -961,9 +962,9 @@ static long sync_serial_ioctl(struct file *file,
{ {
long ret; long ret;
lock_kernel(); mutex_lock(&sync_serial_mutex);
ret = sync_serial_ioctl_unlocked(file, cmd, arg); ret = sync_serial_ioctl_unlocked(file, cmd, arg);
unlock_kernel(); mutex_unlock(&sync_serial_mutex);
return ret; return ret;
} }
......
...@@ -3139,9 +3139,9 @@ cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -3139,9 +3139,9 @@ cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct inode *inode = file->f_path.dentry->d_inode; struct inode *inode = file->f_path.dentry->d_inode;
long ret; long ret;
lock_kernel(); mutex_lock(&cryptocop_mutex);
ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg);
unlock_kernel(); mutex_unlock(&cryptocop_mutex);
return ret; return ret;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <asm/etraxgpio.h> #include <asm/etraxgpio.h>
#include <hwregs/reg_map.h> #include <hwregs/reg_map.h>
...@@ -66,6 +66,7 @@ static int dp_cnt; ...@@ -66,6 +66,7 @@ static int dp_cnt;
#define DP(x) #define DP(x)
#endif #endif
static DEFINE_MUTEX(gpio_mutex);
static char gpio_name[] = "etrax gpio"; static char gpio_name[] = "etrax gpio";
#ifdef CONFIG_ETRAX_VIRTUAL_GPIO #ifdef CONFIG_ETRAX_VIRTUAL_GPIO
...@@ -391,7 +392,7 @@ static int gpio_open(struct inode *inode, struct file *filp) ...@@ -391,7 +392,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
lock_kernel(); mutex_lock(&gpio_mutex);
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
priv->minor = p; priv->minor = p;
...@@ -414,7 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp) ...@@ -414,7 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
spin_unlock_irq(&gpio_lock); spin_unlock_irq(&gpio_lock);
} }
unlock_kernel(); mutex_unlock(&gpio_mutex);
return 0; return 0;
} }
...@@ -667,9 +668,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -667,9 +668,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
long ret; long ret;
lock_kernel(); mutex_lock(&gpio_mutex);
ret = gpio_ioctl_unlocked(file, cmd, arg); ret = gpio_ioctl_unlocked(file, cmd, arg);
unlock_kernel(); mutex_unlock(&gpio_mutex);
return ret; return ret;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <asm/etraxgpio.h> #include <asm/etraxgpio.h>
#include <hwregs/reg_map.h> #include <hwregs/reg_map.h>
...@@ -64,6 +64,7 @@ static int dp_cnt; ...@@ -64,6 +64,7 @@ static int dp_cnt;
#define DP(x) #define DP(x)
#endif #endif
static DEFINE_MUTEX(gpio_mutex);
static char gpio_name[] = "etrax gpio"; static char gpio_name[] = "etrax gpio";
#if 0 #if 0
...@@ -429,7 +430,7 @@ gpio_open(struct inode *inode, struct file *filp) ...@@ -429,7 +430,7 @@ gpio_open(struct inode *inode, struct file *filp)
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
lock_kernel(); mutex_lock(&gpio_mutex);
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
priv->minor = p; priv->minor = p;
...@@ -450,7 +451,7 @@ gpio_open(struct inode *inode, struct file *filp) ...@@ -450,7 +451,7 @@ gpio_open(struct inode *inode, struct file *filp)
alarmlist = priv; alarmlist = priv;
spin_unlock_irq(&alarm_lock); spin_unlock_irq(&alarm_lock);
unlock_kernel(); mutex_unlock(&gpio_mutex);
return 0; return 0;
} }
...@@ -708,9 +709,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -708,9 +709,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
long ret; long ret;
lock_kernel(); mutex_lock(&gpio_mutex);
ret = gpio_ioctl_unlocked(file, cmd, arg); ret = gpio_ioctl_unlocked(file, cmd, arg);
unlock_kernel(); mutex_unlock(&gpio_mutex);
return ret; return ret;
} }
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include <linux/smp_lock.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/mutex.h> #include <linux/mutex.h>
...@@ -45,6 +44,7 @@ ...@@ -45,6 +44,7 @@
#define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x)
#define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y)
static DEFINE_MUTEX(pcf8563_mutex);
static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ static DEFINE_MUTEX(rtc_lock); /* Protect state etc */
static const unsigned char days_in_month[] = static const unsigned char days_in_month[] =
...@@ -339,9 +339,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned ...@@ -339,9 +339,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned
{ {
int ret; int ret;
lock_kernel(); mutex_lock(&pcf8563_mutex);
return pcf8563_ioctl(filp, cmd, arg); return pcf8563_ioctl(filp, cmd, arg);
unlock_kernel(); mutex_unlock(&pcf8563_mutex);
return ret; return ret;
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -145,6 +145,7 @@ typedef struct sync_port ...@@ -145,6 +145,7 @@ typedef struct sync_port
spinlock_t lock; spinlock_t lock;
} sync_port; } sync_port;
static DEFINE_MUTEX(sync_serial_mutex);
static int etrax_sync_serial_init(void); static int etrax_sync_serial_init(void);
static void initialize_port(int portnbr); static void initialize_port(int portnbr);
static inline int sync_data_avail(struct sync_port *port); 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) ...@@ -434,7 +435,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; reg_dma_rw_cfg cfg = {.en = regk_dma_yes};
reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes};
lock_kernel(); mutex_lock(&sync_serial_mutex);
DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));
if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) 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,7 +584,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
port->busy++; port->busy++;
ret = 0; ret = 0;
out: out:
unlock_kernel(); mutex_unlock(&sync_serial_mutex);
return ret; return ret;
} }
...@@ -966,9 +967,9 @@ static long sync_serial_ioctl(struct file *file, ...@@ -966,9 +967,9 @@ static long sync_serial_ioctl(struct file *file,
{ {
long ret; long ret;
lock_kernel(); mutex_lock(&sync_serial_mutex);
ret = sync_serial_ioctl_unlocked(file, cmd, arg); ret = sync_serial_ioctl_unlocked(file, cmd, arg);
unlock_kernel(); mutex_unlock(&sync_serial_mutex);
return ret; return ret;
} }
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/smp_lock.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -261,16 +260,13 @@ printk("Preparing to start counters\n"); ...@@ -261,16 +260,13 @@ printk("Preparing to start counters\n");
*/ */
static int perf_open(struct inode *inode, struct file *file) static int perf_open(struct inode *inode, struct file *file)
{ {
lock_kernel();
spin_lock(&perf_lock); spin_lock(&perf_lock);
if (perf_enabled) { if (perf_enabled) {
spin_unlock(&perf_lock); spin_unlock(&perf_lock);
unlock_kernel();
return -EBUSY; return -EBUSY;
} }
perf_enabled = 1; perf_enabled = 1;
spin_unlock(&perf_lock); spin_unlock(&perf_lock);
unlock_kernel();
return 0; return 0;
} }
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/watchdog.h> #include <linux/watchdog.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static DEFINE_MUTEX(harddog_mutex);
static DEFINE_SPINLOCK(lock); static DEFINE_SPINLOCK(lock);
static int timer_alive; static int timer_alive;
static int harddog_in_fd = -1; static int harddog_in_fd = -1;
...@@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file) ...@@ -66,7 +67,7 @@ static int harddog_open(struct inode *inode, struct file *file)
int err = -EBUSY; int err = -EBUSY;
char *sock = NULL; char *sock = NULL;
lock_kernel(); mutex_lock(&harddog_mutex);
spin_lock(&lock); spin_lock(&lock);
if(timer_alive) if(timer_alive)
goto err; goto err;
...@@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file) ...@@ -83,11 +84,11 @@ static int harddog_open(struct inode *inode, struct file *file)
timer_alive = 1; timer_alive = 1;
spin_unlock(&lock); spin_unlock(&lock);
unlock_kernel(); mutex_unlock(&harddog_mutex);
return nonseekable_open(inode, file); return nonseekable_open(inode, file);
err: err:
spin_unlock(&lock); spin_unlock(&lock);
unlock_kernel(); mutex_unlock(&harddog_mutex);
return err; return err;
} }
...@@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file, ...@@ -153,9 +154,9 @@ static long harddog_ioctl(struct file *file,
{ {
long ret; long ret;
lock_kernel(); mutex_lock(&harddog_mutex);
ret = harddog_ioctl_unlocked(file, cmd, arg); ret = harddog_ioctl_unlocked(file, cmd, arg);
unlock_kernel(); mutex_unlock(&harddog_mutex);
return ret; return ret;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "linux/slab.h" #include "linux/slab.h"
#include "linux/sound.h" #include "linux/sound.h"
#include "linux/soundcard.h" #include "linux/soundcard.h"
#include "linux/smp_lock.h" #include "linux/mutex.h"
#include "asm/uaccess.h" #include "asm/uaccess.h"
#include "init.h" #include "init.h"
#include "os.h" #include "os.h"
...@@ -63,6 +63,8 @@ static int set_mixer(char *name, int *add) ...@@ -63,6 +63,8 @@ static int set_mixer(char *name, int *add)
__uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP); __uml_setup("mixer=", set_mixer, "mixer=<mixer device>\n" MIXER_HELP);
#endif #endif
static DEFINE_MUTEX(hostaudio_mutex);
/* /dev/dsp file operations */ /* /dev/dsp file operations */
static ssize_t hostaudio_read(struct file *file, char __user *buffer, static 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,9 +200,9 @@ static int hostaudio_open(struct inode *inode, struct file *file)
w = 1; w = 1;
kparam_block_sysfs_write(dsp); kparam_block_sysfs_write(dsp);
lock_kernel(); mutex_lock(&hostaudio_mutex);
ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
unlock_kernel(); mutex_unlock(&hostaudio_mutex);
kparam_unblock_sysfs_write(dsp); kparam_unblock_sysfs_write(dsp);
if (ret < 0) { if (ret < 0) {
...@@ -259,9 +261,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file) ...@@ -259,9 +261,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)
w = 1; w = 1;
kparam_block_sysfs_write(mixer); kparam_block_sysfs_write(mixer);
lock_kernel(); mutex_lock(&hostaudio_mutex);
ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
unlock_kernel(); mutex_unlock(&hostaudio_mutex);
kparam_unblock_sysfs_write(mixer); kparam_unblock_sysfs_write(mixer);
if (ret < 0) { if (ret < 0) {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "linux/mm.h" #include "linux/mm.h"
#include "linux/slab.h" #include "linux/slab.h"
#include "linux/vmalloc.h" #include "linux/vmalloc.h"
#include "linux/smp_lock.h" #include "linux/mutex.h"
#include "linux/blkpg.h" #include "linux/blkpg.h"
#include "linux/genhd.h" #include "linux/genhd.h"
#include "linux/spinlock.h" #include "linux/spinlock.h"
...@@ -100,6 +100,7 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data) ...@@ -100,6 +100,7 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)
#define DRIVER_NAME "uml-blkdev" #define DRIVER_NAME "uml-blkdev"
static DEFINE_MUTEX(ubd_lock); static DEFINE_MUTEX(ubd_lock);
static DEFINE_MUTEX(ubd_mutex); /* replaces BKL, might not be needed */
static int ubd_open(struct block_device *bdev, fmode_t mode); static int ubd_open(struct block_device *bdev, fmode_t mode);
static int ubd_release(struct gendisk *disk, fmode_t mode); static 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,7 +1102,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
struct ubd *ubd_dev = disk->private_data; struct ubd *ubd_dev = disk->private_data;
int err = 0; int err = 0;
lock_kernel(); mutex_lock(&ubd_mutex);
if(ubd_dev->count == 0){ if(ubd_dev->count == 0){
err = ubd_open_dev(ubd_dev); err = ubd_open_dev(ubd_dev);
if(err){ if(err){
...@@ -1120,7 +1121,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode) ...@@ -1120,7 +1121,7 @@ static int ubd_open(struct block_device *bdev, fmode_t mode)
err = -EROFS; err = -EROFS;
}*/ }*/
out: out:
unlock_kernel(); mutex_unlock(&ubd_mutex);
return err; return err;
} }
...@@ -1128,10 +1129,10 @@ static int ubd_release(struct gendisk *disk, fmode_t mode) ...@@ -1128,10 +1129,10 @@ static int ubd_release(struct gendisk *disk, fmode_t mode)
{ {
struct ubd *ubd_dev = disk->private_data; struct ubd *ubd_dev = disk->private_data;
lock_kernel(); mutex_lock(&ubd_mutex);
if(--ubd_dev->count == 0) if(--ubd_dev->count == 0)
ubd_close_dev(ubd_dev); ubd_close_dev(ubd_dev);
unlock_kernel(); mutex_unlock(&ubd_mutex);
return 0; return 0;
} }
......
...@@ -78,13 +78,11 @@ long sys_execve(const char __user *file, const char __user *const __user *argv, ...@@ -78,13 +78,11 @@ long sys_execve(const char __user *file, const char __user *const __user *argv,
long error; long error;
char *filename; char *filename;
lock_kernel();
filename = getname(file); filename = getname(file);
error = PTR_ERR(filename); error = PTR_ERR(filename);
if (IS_ERR(filename)) goto out; if (IS_ERR(filename)) goto out;
error = execve1(filename, argv, env); error = execve1(filename, argv, env);
putname(filename); putname(filename);
out: out:
unlock_kernel();
return error; return error;
} }
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/compat.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -67,6 +68,7 @@ ...@@ -67,6 +68,7 @@
#define read_counter(MC) readl(MC) #define read_counter(MC) readl(MC)
#endif #endif
static DEFINE_MUTEX(hpet_mutex); /* replaces BKL */
static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ; static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
/* This clocksource driver currently only works on ia64 */ /* This clocksource driver currently only works on ia64 */
...@@ -250,7 +252,7 @@ static int hpet_open(struct inode *inode, struct file *file) ...@@ -250,7 +252,7 @@ static int hpet_open(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE) if (file->f_mode & FMODE_WRITE)
return -EINVAL; return -EINVAL;
lock_kernel(); mutex_lock(&hpet_mutex);
spin_lock_irq(&hpet_lock); spin_lock_irq(&hpet_lock);
for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) 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,7 +266,7 @@ static int hpet_open(struct inode *inode, struct file *file)
if (!devp) { if (!devp) {
spin_unlock_irq(&hpet_lock); spin_unlock_irq(&hpet_lock);
unlock_kernel(); mutex_unlock(&hpet_mutex);
return -EBUSY; return -EBUSY;
} }
...@@ -272,7 +274,7 @@ static int hpet_open(struct inode *inode, struct file *file) ...@@ -272,7 +274,7 @@ static int hpet_open(struct inode *inode, struct file *file)
devp->hd_irqdata = 0; devp->hd_irqdata = 0;
devp->hd_flags |= HPET_OPEN; devp->hd_flags |= HPET_OPEN;
spin_unlock_irq(&hpet_lock); spin_unlock_irq(&hpet_lock);
unlock_kernel(); mutex_unlock(&hpet_mutex);
hpet_timer_set_irq(devp); hpet_timer_set_irq(devp);
...@@ -429,22 +431,6 @@ static int hpet_release(struct inode *inode, struct file *file) ...@@ -429,22 +431,6 @@ static int hpet_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
static int hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int);
static long hpet_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct hpet_dev *devp;
int ret;
devp = file->private_data;
lock_kernel();
ret = hpet_ioctl_common(devp, cmd, arg, 0);
unlock_kernel();
return ret;
}
static int hpet_ioctl_ieon(struct hpet_dev *devp) static int hpet_ioctl_ieon(struct hpet_dev *devp)
{ {
struct hpet_timer __iomem *timer; struct hpet_timer __iomem *timer;
...@@ -553,7 +539,8 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, ...@@ -553,7 +539,8 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
} }
static int static int
hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg,
struct hpet_info *info)
{ {
struct hpet_timer __iomem *timer; struct hpet_timer __iomem *timer;
struct hpet __iomem *hpet; struct hpet __iomem *hpet;
...@@ -594,23 +581,15 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) ...@@ -594,23 +581,15 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
break; break;
case HPET_INFO: case HPET_INFO:
{ {
struct hpet_info info;
if (devp->hd_ireqfreq) if (devp->hd_ireqfreq)
info.hi_ireqfreq = info->hi_ireqfreq =
hpet_time_div(hpetp, devp->hd_ireqfreq); hpet_time_div(hpetp, devp->hd_ireqfreq);
else else
info.hi_ireqfreq = 0; info->hi_ireqfreq = 0;
info.hi_flags = info->hi_flags =
readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK; readq(&timer->hpet_config) & Tn_PER_INT_CAP_MASK;
info.hi_hpet = hpetp->hp_which; info->hi_hpet = hpetp->hp_which;
info.hi_timer = devp - hpetp->hp_dev; info->hi_timer = devp - hpetp->hp_dev;
if (kernel)
memcpy((void *)arg, &info, sizeof(info));
else
if (copy_to_user((void __user *)arg, &info,
sizeof(info)))
err = -EFAULT;
break; break;
} }
case HPET_EPI: case HPET_EPI:
...@@ -636,7 +615,7 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) ...@@ -636,7 +615,7 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
devp->hd_flags &= ~HPET_PERIODIC; devp->hd_flags &= ~HPET_PERIODIC;
break; break;
case HPET_IRQFREQ: case HPET_IRQFREQ:
if (!kernel && (arg > hpet_max_freq) && if ((arg > hpet_max_freq) &&
!capable(CAP_SYS_RESOURCE)) { !capable(CAP_SYS_RESOURCE)) {
err = -EACCES; err = -EACCES;
break; break;
...@@ -653,12 +632,63 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel) ...@@ -653,12 +632,63 @@ hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
return err; return err;
} }
static long
hpet_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct hpet_info info;
int err;
mutex_lock(&hpet_mutex);
err = hpet_ioctl_common(file->private_data, cmd, arg, &info);
mutex_unlock(&hpet_mutex);
if ((cmd == HPET_INFO) && !err &&
(copy_to_user((void __user *)arg, &info, sizeof(info))))
err = -EFAULT;
return err;
}
#ifdef CONFIG_COMPAT
struct compat_hpet_info {
compat_ulong_t hi_ireqfreq; /* Hz */
compat_ulong_t hi_flags; /* information */
unsigned short hi_hpet;
unsigned short hi_timer;
};
static long
hpet_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct hpet_info info;
int err;
mutex_lock(&hpet_mutex);
err = hpet_ioctl_common(file->private_data, cmd, arg, &info);
mutex_unlock(&hpet_mutex);
if ((cmd == HPET_INFO) && !err) {
struct compat_hpet_info __user *u = compat_ptr(arg);
if (put_user(info.hi_ireqfreq, &u->hi_ireqfreq) ||
put_user(info.hi_flags, &u->hi_flags) ||
put_user(info.hi_hpet, &u->hi_hpet) ||
put_user(info.hi_timer, &u->hi_timer))
err = -EFAULT;
}
return err;
}
#endif
static const struct file_operations hpet_fops = { static const struct file_operations hpet_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek, .llseek = no_llseek,
.read = hpet_read, .read = hpet_read,
.poll = hpet_poll, .poll = hpet_poll,
.unlocked_ioctl = hpet_ioctl, .unlocked_ioctl = hpet_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = hpet_compat_ioctl,
#endif
.open = hpet_open, .open = hpet_open,
.release = hpet_release, .release = hpet_release,
.fasync = hpet_fasync, .fasync = hpet_fasync,
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include <linux/cdev.h> #include <linux/cdev.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/smp_lock.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/compat.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -55,7 +55,6 @@ static int raw_open(struct inode *inode, struct file *filp) ...@@ -55,7 +55,6 @@ static int raw_open(struct inode *inode, struct file *filp)
return 0; return 0;
} }
lock_kernel();
mutex_lock(&raw_mutex); mutex_lock(&raw_mutex);
/* /*
...@@ -82,7 +81,6 @@ static int raw_open(struct inode *inode, struct file *filp) ...@@ -82,7 +81,6 @@ static int raw_open(struct inode *inode, struct file *filp)
bdev->bd_inode->i_mapping; bdev->bd_inode->i_mapping;
filp->private_data = bdev; filp->private_data = bdev;
mutex_unlock(&raw_mutex); mutex_unlock(&raw_mutex);
unlock_kernel();
return 0; return 0;
out2: out2:
...@@ -91,7 +89,6 @@ static int raw_open(struct inode *inode, struct file *filp) ...@@ -91,7 +89,6 @@ static int raw_open(struct inode *inode, struct file *filp)
blkdev_put(bdev, filp->f_mode); blkdev_put(bdev, filp->f_mode);
out: out:
mutex_unlock(&raw_mutex); mutex_unlock(&raw_mutex);
unlock_kernel();
return err; return err;
} }
...@@ -125,20 +122,84 @@ static long ...@@ -125,20 +122,84 @@ static long
raw_ioctl(struct file *filp, unsigned int command, unsigned long arg) raw_ioctl(struct file *filp, unsigned int command, unsigned long arg)
{ {
struct block_device *bdev = filp->private_data; struct block_device *bdev = filp->private_data;
int ret; return blkdev_ioctl(bdev, 0, command, arg);
}
static int bind_set(int number, u64 major, u64 minor)
{
dev_t dev = MKDEV(major, minor);
struct raw_device_data *rawdev;
int err = 0;
lock_kernel(); if (number <= 0 || number >= MAX_RAW_MINORS)
ret = blkdev_ioctl(bdev, 0, command, arg); return -EINVAL;
unlock_kernel();
return ret; if (MAJOR(dev) != major || MINOR(dev) != minor)
return -EINVAL;
rawdev = &raw_devices[number];
/*
* This is like making block devices, so demand the
* same capability
*/
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
/*
* For now, we don't need to check that the underlying
* block device is present or not: we can do that when
* the raw device is opened. Just check that the
* major/minor numbers make sense.
*/
if (MAJOR(dev) == 0 && dev != 0)
return -EINVAL;
mutex_lock(&raw_mutex);
if (rawdev->inuse) {
mutex_unlock(&raw_mutex);
return -EBUSY;
}
if (rawdev->binding) {
bdput(rawdev->binding);
module_put(THIS_MODULE);
}
if (!dev) {
/* unbind */
rawdev->binding = NULL;
device_destroy(raw_class, MKDEV(RAW_MAJOR, number));
} else {
rawdev->binding = bdget(dev);
if (rawdev->binding == NULL) {
err = -ENOMEM;
} else {
dev_t raw = MKDEV(RAW_MAJOR, number);
__module_get(THIS_MODULE);
device_destroy(raw_class, raw);
device_create(raw_class, NULL, raw, NULL,
"raw%d", number);
}
}
mutex_unlock(&raw_mutex);
return err;
} }
static void bind_device(struct raw_config_request *rq) static int bind_get(int number, dev_t *dev)
{ {
device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor)); struct raw_device_data *rawdev;
device_create(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor), NULL, struct block_device *bdev;
"raw%d", rq->raw_minor);
if (number <= 0 || number >= MAX_RAW_MINORS)
return -EINVAL;
rawdev = &raw_devices[number];
mutex_lock(&raw_mutex);
bdev = rawdev->binding;
*dev = bdev ? bdev->bd_dev : 0;
mutex_unlock(&raw_mutex);
return 0;
} }
/* /*
...@@ -149,105 +210,78 @@ static long raw_ctl_ioctl(struct file *filp, unsigned int command, ...@@ -149,105 +210,78 @@ static long raw_ctl_ioctl(struct file *filp, unsigned int command,
unsigned long arg) unsigned long arg)
{ {
struct raw_config_request rq; struct raw_config_request rq;
struct raw_device_data *rawdev; dev_t dev;
int err = 0; int err;
lock_kernel();
switch (command) { switch (command) {
case RAW_SETBIND: case RAW_SETBIND:
if (copy_from_user(&rq, (void __user *) arg, sizeof(rq)))
return -EFAULT;
return bind_set(rq.raw_minor, rq.block_major, rq.block_minor);
case RAW_GETBIND: case RAW_GETBIND:
if (copy_from_user(&rq, (void __user *) arg, sizeof(rq)))
return -EFAULT;
/* First, find out which raw minor we want */ err = bind_get(rq.raw_minor, &dev);
if (err)
return err;
if (copy_from_user(&rq, (void __user *) arg, sizeof(rq))) { rq.block_major = MAJOR(dev);
err = -EFAULT; rq.block_minor = MINOR(dev);
goto out;
}
if (rq.raw_minor <= 0 || rq.raw_minor >= MAX_RAW_MINORS) { if (copy_to_user((void __user *)arg, &rq, sizeof(rq)))
err = -EINVAL; return -EFAULT;
goto out;
} return 0;
rawdev = &raw_devices[rq.raw_minor];
if (command == RAW_SETBIND) {
dev_t dev;
/*
* This is like making block devices, so demand the
* same capability
*/
if (!capable(CAP_SYS_ADMIN)) {
err = -EPERM;
goto out;
}
/*
* For now, we don't need to check that the underlying
* block device is present or not: we can do that when
* the raw device is opened. Just check that the
* major/minor numbers make sense.
*/
dev = MKDEV(rq.block_major, rq.block_minor);
if ((rq.block_major == 0 && rq.block_minor != 0) ||
MAJOR(dev) != rq.block_major ||
MINOR(dev) != rq.block_minor) {
err = -EINVAL;
goto out;
}
mutex_lock(&raw_mutex);
if (rawdev->inuse) {
mutex_unlock(&raw_mutex);
err = -EBUSY;
goto out;
}
if (rawdev->binding) {
bdput(rawdev->binding);
module_put(THIS_MODULE);
}
if (rq.block_major == 0 && rq.block_minor == 0) {
/* unbind */
rawdev->binding = NULL;
device_destroy(raw_class,
MKDEV(RAW_MAJOR, rq.raw_minor));
} else {
rawdev->binding = bdget(dev);
if (rawdev->binding == NULL)
err = -ENOMEM;
else {
__module_get(THIS_MODULE);
bind_device(&rq);
}
}
mutex_unlock(&raw_mutex);
} else {
struct block_device *bdev;
mutex_lock(&raw_mutex);
bdev = rawdev->binding;
if (bdev) {
rq.block_major = MAJOR(bdev->bd_dev);
rq.block_minor = MINOR(bdev->bd_dev);
} else {
rq.block_major = rq.block_minor = 0;
}
mutex_unlock(&raw_mutex);
if (copy_to_user((void __user *)arg, &rq, sizeof(rq))) {
err = -EFAULT;
goto out;
}
}
break;
default:
err = -EINVAL;
break;
} }
out:
unlock_kernel(); return -EINVAL;
return err; }
#ifdef CONFIG_COMPAT
struct raw32_config_request {
compat_int_t raw_minor;
compat_u64 block_major;
compat_u64 block_minor;
};
static long raw_ctl_compat_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct raw32_config_request __user *user_req = compat_ptr(arg);
struct raw32_config_request rq;
dev_t dev;
int err = 0;
switch (cmd) {
case RAW_SETBIND:
if (copy_from_user(&rq, user_req, sizeof(rq)))
return -EFAULT;
return bind_set(rq.raw_minor, rq.block_major, rq.block_minor);
case RAW_GETBIND:
if (copy_from_user(&rq, user_req, sizeof(rq)))
return -EFAULT;
err = bind_get(rq.raw_minor, &dev);
if (err)
return err;
rq.block_major = MAJOR(dev);
rq.block_minor = MINOR(dev);
if (copy_to_user(user_req, &rq, sizeof(rq)))
return -EFAULT;
return 0;
}
return -EINVAL;
} }
#endif
static const struct file_operations raw_fops = { static const struct file_operations raw_fops = {
.read = do_sync_read, .read = do_sync_read,
...@@ -263,6 +297,9 @@ static const struct file_operations raw_fops = { ...@@ -263,6 +297,9 @@ static const struct file_operations raw_fops = {
static const struct file_operations raw_ctl_fops = { static const struct file_operations raw_ctl_fops = {
.unlocked_ioctl = raw_ctl_ioctl, .unlocked_ioctl = raw_ctl_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = raw_ctl_compat_ioctl,
#endif
.open = raw_open, .open = raw_open,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/sysfs.h> #include <linux/sysfs.h>
#include <linux/device.h> #include <linux/device.h>
...@@ -206,7 +206,7 @@ static int tlclk_open(struct inode *inode, struct file *filp) ...@@ -206,7 +206,7 @@ static int tlclk_open(struct inode *inode, struct file *filp)
{ {
int result; int result;
lock_kernel(); mutex_lock(&tlclk_mutex);
if (test_and_set_bit(0, &useflags)) { if (test_and_set_bit(0, &useflags)) {
result = -EBUSY; result = -EBUSY;
/* this legacy device is always one per system and it doesn't /* 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,7 +229,7 @@ static int tlclk_open(struct inode *inode, struct file *filp)
inb(TLCLK_REG6); /* Clear interrupt events */ inb(TLCLK_REG6); /* Clear interrupt events */
out: out:
unlock_kernel(); mutex_unlock(&tlclk_mutex);
return result; return result;
} }
......
...@@ -73,7 +73,8 @@ source "drivers/gpu/drm/radeon/Kconfig" ...@@ -73,7 +73,8 @@ source "drivers/gpu/drm/radeon/Kconfig"
config DRM_I810 config DRM_I810
tristate "Intel I810" tristate "Intel I810"
depends on DRM && AGP && AGP_INTEL # BKL usage in order to avoid AB-BA deadlocks, may become BROKEN_ON_SMP
depends on DRM && AGP && AGP_INTEL && BKL
help help
Choose this option if you have an Intel I810 graphics card. If M is Choose this option if you have an Intel I810 graphics card. If M is
selected, the module will be called i810. AGP support is required selected, the module will be called i810. AGP support is required
...@@ -86,6 +87,8 @@ choice ...@@ -86,6 +87,8 @@ choice
config DRM_I830 config DRM_I830
tristate "i830 driver" tristate "i830 driver"
# BKL usage in order to avoid AB-BA deadlocks, i830 may get removed
depends on BKL
help help
Choose this option if you have a system that has Intel 830M, 845G, Choose this option if you have a system that has Intel 830M, 845G,
852GM, 855GM or 865G integrated graphics. If M is selected, the 852GM, 855GM or 865G integrated graphics. If M is selected, the
......
...@@ -19,6 +19,7 @@ comment "Multimedia core support" ...@@ -19,6 +19,7 @@ comment "Multimedia core support"
config VIDEO_DEV config VIDEO_DEV
tristate "Video For Linux" tristate "Video For Linux"
depends on BKL # used in many drivers for ioctl handling, need to kill
---help--- ---help---
V4L core support for video capture and overlay devices, webcams and V4L core support for video capture and overlay devices, webcams and
AM/FM radio cards. AM/FM radio cards.
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/dvb/ca.h> #include <linux/dvb/ca.h>
#include "dvbdev.h" #include "dvbdev.h"
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
} while(0) } while(0)
static DEFINE_MUTEX(dst_ca_mutex);
static unsigned int verbose = 5; static unsigned int verbose = 5;
module_param(verbose, int, 0644); module_param(verbose, int, 0644);
MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)"); MODULE_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,7 +565,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
void __user *arg = (void __user *)ioctl_arg; void __user *arg = (void __user *)ioctl_arg;
int result = 0; int result = 0;
lock_kernel(); mutex_lock(&dst_ca_mutex);
dvbdev = file->private_data; dvbdev = file->private_data;
state = (struct dst_state *)dvbdev->priv; state = (struct dst_state *)dvbdev->priv;
p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); 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,7 +653,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
kfree (p_ca_slot_info); kfree (p_ca_slot_info);
kfree (p_ca_caps); kfree (p_ca_caps);
unlock_kernel(); mutex_unlock(&dst_ca_mutex);
return result; return result;
} }
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/smp_lock.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/ioctl.h> #include <linux/ioctl.h>
#include <linux/wait.h> #include <linux/wait.h>
...@@ -1088,13 +1087,7 @@ static int dvb_demux_do_ioctl(struct file *file, ...@@ -1088,13 +1087,7 @@ static int dvb_demux_do_ioctl(struct file *file,
static long dvb_demux_ioctl(struct file *file, unsigned int cmd, static long dvb_demux_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
int ret; return dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
unlock_kernel();
return ret;
} }
static unsigned int dvb_demux_poll(struct file *file, poll_table *wait) static unsigned int dvb_demux_poll(struct file *file, poll_table *wait)
...@@ -1186,13 +1179,7 @@ static int dvb_dvr_do_ioctl(struct file *file, ...@@ -1186,13 +1179,7 @@ static int dvb_dvr_do_ioctl(struct file *file,
static long dvb_dvr_ioctl(struct file *file, static long dvb_dvr_ioctl(struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
int ret; return dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
unlock_kernel();
return ret;
} }
static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait) static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait)
......
...@@ -1259,13 +1259,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file, ...@@ -1259,13 +1259,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
static long dvb_ca_en50221_io_ioctl(struct file *file, static long dvb_ca_en50221_io_ioctl(struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
int ret; return dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
unlock_kernel();
return ret;
} }
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/dvb/net.h> #include <linux/dvb/net.h>
#include <linux/smp_lock.h>
#include <linux/uio.h> #include <linux/uio.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <linux/crc32.h> #include <linux/crc32.h>
...@@ -1445,13 +1444,7 @@ static int dvb_net_do_ioctl(struct file *file, ...@@ -1445,13 +1444,7 @@ static int dvb_net_do_ioctl(struct file *file,
static long dvb_net_ioctl(struct file *file, static long dvb_net_ioctl(struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
int ret; return dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
unlock_kernel();
return ret;
} }
static int dvb_net_close(struct inode *inode, struct file *file) static int dvb_net_close(struct inode *inode, struct file *file)
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/cdev.h> #include <linux/cdev.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/smp_lock.h>
#include "dvbdev.h" #include "dvbdev.h"
static DEFINE_MUTEX(dvbdev_mutex);
static int dvbdev_debug; static int dvbdev_debug;
module_param(dvbdev_debug, int, 0644); module_param(dvbdev_debug, int, 0644);
...@@ -68,7 +68,7 @@ static int dvb_device_open(struct inode *inode, struct file *file) ...@@ -68,7 +68,7 @@ static int dvb_device_open(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev; struct dvb_device *dvbdev;
lock_kernel(); mutex_lock(&dvbdev_mutex);
down_read(&minor_rwsem); down_read(&minor_rwsem);
dvbdev = dvb_minors[iminor(inode)]; dvbdev = dvb_minors[iminor(inode)];
...@@ -91,12 +91,12 @@ static int dvb_device_open(struct inode *inode, struct file *file) ...@@ -91,12 +91,12 @@ static int dvb_device_open(struct inode *inode, struct file *file)
} }
fops_put(old_fops); fops_put(old_fops);
up_read(&minor_rwsem); up_read(&minor_rwsem);
unlock_kernel(); mutex_unlock(&dvbdev_mutex);
return err; return err;
} }
fail: fail:
up_read(&minor_rwsem); up_read(&minor_rwsem);
unlock_kernel(); mutex_unlock(&dvbdev_mutex);
return -ENODEV; return -ENODEV;
} }
...@@ -158,7 +158,6 @@ long dvb_generic_ioctl(struct file *file, ...@@ -158,7 +158,6 @@ long dvb_generic_ioctl(struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
struct dvb_device *dvbdev = file->private_data; struct dvb_device *dvbdev = file->private_data;
int ret;
if (!dvbdev) if (!dvbdev)
return -ENODEV; return -ENODEV;
...@@ -166,11 +165,7 @@ long dvb_generic_ioctl(struct file *file, ...@@ -166,11 +165,7 @@ long dvb_generic_ioctl(struct file *file,
if (!dvbdev->kernel_ioctl) if (!dvbdev->kernel_ioctl)
return -EINVAL; return -EINVAL;
lock_kernel(); return dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl);
ret = dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl);
unlock_kernel();
return ret;
} }
EXPORT_SYMBOL(dvb_generic_ioctl); EXPORT_SYMBOL(dvb_generic_ioctl);
...@@ -421,8 +416,10 @@ int dvb_usercopy(struct file *file, ...@@ -421,8 +416,10 @@ int dvb_usercopy(struct file *file,
} }
/* call driver */ /* call driver */
mutex_lock(&dvbdev_mutex);
if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD) if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD)
err = -EINVAL; err = -EINVAL;
mutex_unlock(&dvbdev_mutex);
if (err < 0) if (err < 0)
goto out; goto out;
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/init.h> #include <linux/init.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -621,7 +620,6 @@ static int dabusb_open (struct inode *inode, struct file *file) ...@@ -621,7 +620,6 @@ static int dabusb_open (struct inode *inode, struct file *file)
if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB)) if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB))
return -EIO; return -EIO;
lock_kernel();
s = &dabusb[devnum - DABUSB_MINOR]; s = &dabusb[devnum - DABUSB_MINOR];
dbg("dabusb_open"); dbg("dabusb_open");
...@@ -630,21 +628,17 @@ static int dabusb_open (struct inode *inode, struct file *file) ...@@ -630,21 +628,17 @@ static int dabusb_open (struct inode *inode, struct file *file)
while (!s->usbdev || s->opened) { while (!s->usbdev || s->opened) {
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
if (file->f_flags & O_NONBLOCK) { if (file->f_flags & O_NONBLOCK)
return -EBUSY; return -EBUSY;
}
msleep_interruptible(500); msleep_interruptible(500);
if (signal_pending (current)) { if (signal_pending (current))
unlock_kernel();
return -EAGAIN; return -EAGAIN;
}
mutex_lock(&s->mutex); mutex_lock(&s->mutex);
} }
if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) { if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) {
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
dev_err(&s->usbdev->dev, "set_interface failed\n"); dev_err(&s->usbdev->dev, "set_interface failed\n");
unlock_kernel();
return -EINVAL; return -EINVAL;
} }
s->opened = 1; s->opened = 1;
...@@ -654,7 +648,6 @@ static int dabusb_open (struct inode *inode, struct file *file) ...@@ -654,7 +648,6 @@ static int dabusb_open (struct inode *inode, struct file *file)
file->private_data = s; file->private_data = s;
r = nonseekable_open(inode, file); r = nonseekable_open(inode, file);
unlock_kernel();
return r; return r;
} }
...@@ -689,17 +682,13 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg ...@@ -689,17 +682,13 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg
dbg("dabusb_ioctl"); dbg("dabusb_ioctl");
lock_kernel(); if (s->remove_pending)
if (s->remove_pending) {
unlock_kernel();
return -EIO; return -EIO;
}
mutex_lock(&s->mutex); mutex_lock(&s->mutex);
if (!s->usbdev) { if (!s->usbdev) {
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
unlock_kernel();
return -EIO; return -EIO;
} }
...@@ -735,7 +724,6 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg ...@@ -735,7 +724,6 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg
break; break;
} }
mutex_unlock(&s->mutex); mutex_unlock(&s->mutex);
unlock_kernel();
return ret; return ret;
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
config ATALK config ATALK
tristate "Appletalk protocol support" tristate "Appletalk protocol support"
depends on BKL # waiting to be removed from net/appletalk/ddp.c
select LLC select LLC
---help--- ---help---
AppleTalk is the protocol that Apple computers can use to communicate AppleTalk is the protocol that Apple computers can use to communicate
......
...@@ -31,8 +31,9 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL; ...@@ -31,8 +31,9 @@ static struct proc_dir_entry *isapnp_proc_bus_dir = NULL;
static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
{ {
loff_t new = -1; loff_t new = -1;
struct inode *inode = file->f_path.dentry->d_inode;
lock_kernel(); mutex_lock(&inode->i_mutex);
switch (whence) { switch (whence) {
case 0: case 0:
new = off; new = off;
...@@ -44,12 +45,12 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) ...@@ -44,12 +45,12 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
new = 256 + off; new = 256 + off;
break; break;
} }
if (new < 0 || new > 256) { if (new < 0 || new > 256)
unlock_kernel(); new = -EINVAL;
return -EINVAL; else
} file->f_pos = new;
unlock_kernel(); mutex_unlock(&inode->i_mutex);
return (file->f_pos = new); return new;
} }
static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/async.h> #include <linux/async.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/smp_lock.h>
#include <asm/ccwdev.h> #include <asm/ccwdev.h>
#include <asm/ebcdic.h> #include <asm/ebcdic.h>
...@@ -2236,7 +2235,6 @@ static int dasd_open(struct block_device *bdev, fmode_t mode) ...@@ -2236,7 +2235,6 @@ static int dasd_open(struct block_device *bdev, fmode_t mode)
if (!block) if (!block)
return -ENODEV; return -ENODEV;
lock_kernel();
base = block->base; base = block->base;
atomic_inc(&block->open_count); atomic_inc(&block->open_count);
if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) { if (test_bit(DASD_FLAG_OFFLINE, &base->flags)) {
...@@ -2271,14 +2269,12 @@ static int dasd_open(struct block_device *bdev, fmode_t mode) ...@@ -2271,14 +2269,12 @@ static int dasd_open(struct block_device *bdev, fmode_t mode)
goto out; goto out;
} }
unlock_kernel();
return 0; return 0;
out: out:
module_put(base->discipline->owner); module_put(base->discipline->owner);
unlock: unlock:
atomic_dec(&block->open_count); atomic_dec(&block->open_count);
unlock_kernel();
return rc; return rc;
} }
...@@ -2286,10 +2282,8 @@ static int dasd_release(struct gendisk *disk, fmode_t mode) ...@@ -2286,10 +2282,8 @@ static int dasd_release(struct gendisk *disk, fmode_t mode)
{ {
struct dasd_block *block = disk->private_data; struct dasd_block *block = disk->private_data;
lock_kernel();
atomic_dec(&block->open_count); atomic_dec(&block->open_count);
module_put(block->base->discipline->owner); module_put(block->base->discipline->owner);
unlock_kernel();
return 0; return 0;
} }
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/blkpg.h> #include <linux/blkpg.h>
#include <linux/smp_lock.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/compat.h> #include <asm/compat.h>
#include <asm/ccwdev.h> #include <asm/ccwdev.h>
...@@ -370,9 +369,8 @@ static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd, ...@@ -370,9 +369,8 @@ static int dasd_ioctl_readall_cmb(struct dasd_block *block, unsigned int cmd,
return ret; return ret;
} }
static int int dasd_ioctl(struct block_device *bdev, fmode_t mode,
dasd_do_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
unsigned int cmd, unsigned long arg)
{ {
struct dasd_block *block = bdev->bd_disk->private_data; struct dasd_block *block = bdev->bd_disk->private_data;
void __user *argp; void __user *argp;
...@@ -430,14 +428,3 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -430,14 +428,3 @@ dasd_do_ioctl(struct block_device *bdev, fmode_t mode,
return -EINVAL; return -EINVAL;
} }
} }
int dasd_ioctl(struct block_device *bdev, fmode_t mode,
unsigned int cmd, unsigned long arg)
{
int rc;
lock_kernel();
rc = dasd_do_ioctl(bdev, mode, cmd, arg);
unlock_kernel();
return rc;
}
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/smp_lock.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -776,7 +775,6 @@ dcssblk_open(struct block_device *bdev, fmode_t mode) ...@@ -776,7 +775,6 @@ dcssblk_open(struct block_device *bdev, fmode_t mode)
struct dcssblk_dev_info *dev_info; struct dcssblk_dev_info *dev_info;
int rc; int rc;
lock_kernel();
dev_info = bdev->bd_disk->private_data; dev_info = bdev->bd_disk->private_data;
if (NULL == dev_info) { if (NULL == dev_info) {
rc = -ENODEV; rc = -ENODEV;
...@@ -786,7 +784,6 @@ dcssblk_open(struct block_device *bdev, fmode_t mode) ...@@ -786,7 +784,6 @@ dcssblk_open(struct block_device *bdev, fmode_t mode)
bdev->bd_block_size = 4096; bdev->bd_block_size = 4096;
rc = 0; rc = 0;
out: out:
unlock_kernel();
return rc; return rc;
} }
...@@ -797,7 +794,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode) ...@@ -797,7 +794,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode)
struct segment_info *entry; struct segment_info *entry;
int rc; int rc;
lock_kernel();
if (!dev_info) { if (!dev_info) {
rc = -ENODEV; rc = -ENODEV;
goto out; goto out;
...@@ -815,7 +811,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode) ...@@ -815,7 +811,6 @@ dcssblk_release(struct gendisk *disk, fmode_t mode)
up_write(&dcssblk_devices_sem); up_write(&dcssblk_devices_sem);
rc = 0; rc = 0;
out: out:
unlock_kernel();
return rc; return rc;
} }
......
config VIDEO_CX25821 config VIDEO_CX25821
tristate "Conexant cx25821 support" tristate "Conexant cx25821 support"
depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT depends on DVB_CORE && VIDEO_DEV && PCI && I2C && INPUT
depends on BKL # please fix
select I2C_ALGOBIT select I2C_ALGOBIT
select VIDEO_BTCX select VIDEO_BTCX
select VIDEO_TVEEPROM select VIDEO_TVEEPROM
......
config EASYCAP config EASYCAP
tristate "EasyCAP USB ID 05e1:0408 support" tristate "EasyCAP USB ID 05e1:0408 support"
depends on USB && VIDEO_DEV depends on USB && VIDEO_DEV
depends on BKL # please fix
---help--- ---help---
This is an integrated audio/video driver for EasyCAP cards with This is an integrated audio/video driver for EasyCAP cards with
......
config VIDEO_GO7007 config VIDEO_GO7007
tristate "WIS GO7007 MPEG encoder support" tristate "WIS GO7007 MPEG encoder support"
depends on VIDEO_DEV && PCI && I2C && INPUT depends on VIDEO_DEV && PCI && I2C && INPUT
depends on BKL # please fix
depends on SND depends on SND
select VIDEOBUF_DMA_SG select VIDEOBUF_DMA_SG
select VIDEO_IR select VIDEO_IR
......
config USB_IP_COMMON config USB_IP_COMMON
tristate "USB IP support (EXPERIMENTAL)" tristate "USB IP support (EXPERIMENTAL)"
depends on USB && NET && EXPERIMENTAL depends on USB && NET && EXPERIMENTAL && BKL
default N default N
---help--- ---help---
This enables pushing USB packets over IP to allow remote This enables pushing USB packets over IP to allow remote
......
...@@ -50,6 +50,7 @@ endif # BLOCK ...@@ -50,6 +50,7 @@ endif # BLOCK
config FILE_LOCKING config FILE_LOCKING
bool "Enable POSIX file locking API" if EMBEDDED bool "Enable POSIX file locking API" if EMBEDDED
default y default y
select BKL # while lockd still uses it.
help help
This option enables standard file locking support, required This option enables standard file locking support, required
for filesystems like NFS and for the flock() system for filesystems like NFS and for the flock() system
......
config ADFS_FS config ADFS_FS
tristate "ADFS file system support (EXPERIMENTAL)" tristate "ADFS file system support (EXPERIMENTAL)"
depends on BLOCK && EXPERIMENTAL depends on BLOCK && EXPERIMENTAL
depends on BKL # need to fix
help help
The Acorn Disc Filing System is the standard file system of the The Acorn Disc Filing System is the standard file system of the
RiscOS operating system which runs on Acorn's ARM-based Risc PC RiscOS operating system which runs on Acorn's ARM-based Risc PC
......
config AUTOFS_FS config AUTOFS_FS
tristate "Kernel automounter support" tristate "Kernel automounter support"
depends on BKL # unfixable, just use autofs4
help help
The automounter is a tool to automatically mount remote file systems The automounter is a tool to automatically mount remote file systems
on demand. This implementation is partially kernel-based to reduce on demand. This implementation is partially kernel-based to reduce
......
...@@ -599,69 +599,6 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd, ...@@ -599,69 +599,6 @@ static int do_smb_getmountuid(unsigned int fd, unsigned int cmd,
#define HIDPGETCONNLIST _IOR('H', 210, int) #define HIDPGETCONNLIST _IOR('H', 210, int)
#define HIDPGETCONNINFO _IOR('H', 211, int) #define HIDPGETCONNINFO _IOR('H', 211, int)
#ifdef CONFIG_BLOCK
struct raw32_config_request
{
compat_int_t raw_minor;
__u64 block_major;
__u64 block_minor;
} __attribute__((packed));
static int get_raw32_request(struct raw_config_request *req, struct raw32_config_request __user *user_req)
{
int ret;
if (!access_ok(VERIFY_READ, user_req, sizeof(struct raw32_config_request)))
return -EFAULT;
ret = __get_user(req->raw_minor, &user_req->raw_minor);
ret |= __get_user(req->block_major, &user_req->block_major);
ret |= __get_user(req->block_minor, &user_req->block_minor);
return ret ? -EFAULT : 0;
}
static int set_raw32_request(struct raw_config_request *req, struct raw32_config_request __user *user_req)
{
int ret;
if (!access_ok(VERIFY_WRITE, user_req, sizeof(struct raw32_config_request)))
return -EFAULT;
ret = __put_user(req->raw_minor, &user_req->raw_minor);
ret |= __put_user(req->block_major, &user_req->block_major);
ret |= __put_user(req->block_minor, &user_req->block_minor);
return ret ? -EFAULT : 0;
}
static int raw_ioctl(unsigned fd, unsigned cmd,
struct raw32_config_request __user *user_req)
{
int ret;
switch (cmd) {
case RAW_SETBIND:
default: { /* RAW_GETBIND */
struct raw_config_request req;
mm_segment_t oldfs = get_fs();
if ((ret = get_raw32_request(&req, user_req)))
return ret;
set_fs(KERNEL_DS);
ret = sys_ioctl(fd,cmd,(unsigned long)&req);
set_fs(oldfs);
if ((!ret) && (cmd == RAW_GETBIND)) {
ret = set_raw32_request(&req, user_req);
}
break;
}
}
return ret;
}
#endif /* CONFIG_BLOCK */
struct serial_struct32 { struct serial_struct32 {
compat_int_t type; compat_int_t type;
...@@ -1262,9 +1199,6 @@ COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5) ...@@ -1262,9 +1199,6 @@ COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5)
COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS) COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS)
COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS) COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS)
COMPATIBLE_IOCTL(OSS_GETVERSION) COMPATIBLE_IOCTL(OSS_GETVERSION)
/* Raw devices */
COMPATIBLE_IOCTL(RAW_SETBIND)
COMPATIBLE_IOCTL(RAW_GETBIND)
/* SMB ioctls which do not need any translations */ /* SMB ioctls which do not need any translations */
COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) COMPATIBLE_IOCTL(SMB_IOC_NEWCONN)
/* Watchdog */ /* Watchdog */
...@@ -1523,10 +1457,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd, ...@@ -1523,10 +1457,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd,
case MTIOCGET32: case MTIOCGET32:
case MTIOCPOS32: case MTIOCPOS32:
return mt_ioctl_trans(fd, cmd, argp); return mt_ioctl_trans(fd, cmd, argp);
/* Raw devices */
case RAW_SETBIND:
case RAW_GETBIND:
return raw_ioctl(fd, cmd, argp);
#endif #endif
/* One SMB ioctl needs translations. */ /* One SMB ioctl needs translations. */
#define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t) #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
......
config HPFS_FS config HPFS_FS
tristate "OS/2 HPFS file system support" tristate "OS/2 HPFS file system support"
depends on BLOCK depends on BLOCK
depends on BKL # nontrivial to fix
help help
OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
is the file system used for organizing files on OS/2 hard disk is the file system used for organizing files on OS/2 hard disk
......
config NFS_FS config NFS_FS
tristate "NFS client support" tristate "NFS client support"
depends on INET && FILE_LOCKING depends on INET && FILE_LOCKING
depends on BKL # fix as soon as lockd is done
select LOCKD select LOCKD
select SUNRPC select SUNRPC
select NFS_ACL_SUPPORT if NFS_V3_ACL select NFS_ACL_SUPPORT if NFS_V3_ACL
......
...@@ -2,6 +2,7 @@ config NFSD ...@@ -2,6 +2,7 @@ config NFSD
tristate "NFS server support" tristate "NFS server support"
depends on INET depends on INET
depends on FILE_LOCKING depends on FILE_LOCKING
depends on BKL # fix as soon as lockd is done
select LOCKD select LOCKD
select SUNRPC select SUNRPC
select EXPORTFS select EXPORTFS
......
config SMB_FS config SMB_FS
tristate "SMB file system support (OBSOLETE, please use CIFS)" tristate "SMB file system support (OBSOLETE, please use CIFS)"
depends on BKL # probably unfixable
depends on INET depends on INET
select NLS select NLS
help help
......
config UDF_FS config UDF_FS
tristate "UDF file system support" tristate "UDF file system support"
depends on BKL # needs serious work to remove
select CRC_ITU_T select CRC_ITU_T
help help
This is the new file system used on some CD-ROMs and DVDs. Say Y if This is the new file system used on some CD-ROMs and DVDs. Say Y if
......
config UFS_FS config UFS_FS
tristate "UFS file system support (read only)" tristate "UFS file system support (read only)"
depends on BLOCK depends on BLOCK
depends on BKL # probably fixable
help help
BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD, BSD and derivate versions of Unix (such as SunOS, FreeBSD, NetBSD,
OpenBSD and NeXTstep) use a file system called UFS. Some System V OpenBSD and NeXTstep) use a file system called UFS. Some System V
......
...@@ -54,12 +54,15 @@ static inline void cycle_kernel_lock(void) ...@@ -54,12 +54,15 @@ static inline void cycle_kernel_lock(void)
#else #else
#ifdef CONFIG_BKL /* provoke build bug if not set */
#define lock_kernel() #define lock_kernel()
#define unlock_kernel() #define unlock_kernel()
#define release_kernel_lock(task) do { } while(0)
#define cycle_kernel_lock() do { } while(0) #define cycle_kernel_lock() do { } while(0)
#define reacquire_kernel_lock(task) 0
#define kernel_locked() 1 #define kernel_locked() 1
#endif /* CONFIG_BKL */
#define release_kernel_lock(task) do { } while(0)
#define reacquire_kernel_lock(task) 0
#endif /* CONFIG_LOCK_KERNEL */ #endif /* CONFIG_LOCK_KERNEL */
#endif /* __LINUX_SMPLOCK_H */ #endif /* __LINUX_SMPLOCK_H */
...@@ -71,7 +71,7 @@ config BROKEN_ON_SMP ...@@ -71,7 +71,7 @@ config BROKEN_ON_SMP
config LOCK_KERNEL config LOCK_KERNEL
bool bool
depends on SMP || PREEMPT depends on (SMP || PREEMPT) && BKL
default y default y
config INIT_ENV_ARG_LIMIT config INIT_ENV_ARG_LIMIT
......
...@@ -424,7 +424,6 @@ static void __init setup_command_line(char *command_line) ...@@ -424,7 +424,6 @@ static void __init setup_command_line(char *command_line)
static __initdata DECLARE_COMPLETION(kthreadd_done); static __initdata DECLARE_COMPLETION(kthreadd_done);
static noinline void __init_refok rest_init(void) static noinline void __init_refok rest_init(void)
__releases(kernel_lock)
{ {
int pid; int pid;
...@@ -818,7 +817,6 @@ static void run_init_process(const char *init_filename) ...@@ -818,7 +817,6 @@ static void run_init_process(const char *init_filename)
* makes it inline to init() and it becomes part of init.text section * makes it inline to init() and it becomes part of init.text section
*/ */
static noinline int init_post(void) static noinline int init_post(void)
__releases(kernel_lock)
{ {
/* need to finish all async __init code before freeing the memory */ /* need to finish all async __init code before freeing the memory */
async_synchronize_full(); async_synchronize_full();
......
...@@ -76,7 +76,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) ...@@ -76,7 +76,9 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
} }
if (!lockwakeup && td->bkl == 4) { if (!lockwakeup && td->bkl == 4) {
#ifdef CONFIG_LOCK_KERNEL
unlock_kernel(); unlock_kernel();
#endif
td->bkl = 0; td->bkl = 0;
} }
return 0; return 0;
...@@ -133,14 +135,18 @@ static int handle_op(struct test_thread_data *td, int lockwakeup) ...@@ -133,14 +135,18 @@ static int handle_op(struct test_thread_data *td, int lockwakeup)
if (td->bkl) if (td->bkl)
return 0; return 0;
td->bkl = 1; td->bkl = 1;
#ifdef CONFIG_LOCK_KERNEL
lock_kernel(); lock_kernel();
#endif
td->bkl = 4; td->bkl = 4;
return 0; return 0;
case RTTEST_UNLOCKBKL: case RTTEST_UNLOCKBKL:
if (td->bkl != 4) if (td->bkl != 4)
break; break;
#ifdef CONFIG_LOCK_KERNEL
unlock_kernel(); unlock_kernel();
#endif
td->bkl = 0; td->bkl = 0;
return 0; return 0;
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/smp_lock.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
...@@ -639,7 +638,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) ...@@ -639,7 +638,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
if (!q) if (!q)
return -ENXIO; return -ENXIO;
lock_kernel();
mutex_lock(&bdev->bd_mutex); mutex_lock(&bdev->bd_mutex);
switch (cmd) { switch (cmd) {
...@@ -667,7 +665,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) ...@@ -667,7 +665,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
} }
mutex_unlock(&bdev->bd_mutex); mutex_unlock(&bdev->bd_mutex);
unlock_kernel();
return ret; return ret;
} }
...@@ -1652,10 +1649,9 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev, ...@@ -1652,10 +1649,9 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
struct block_device *bdev; struct block_device *bdev;
ssize_t ret = -ENXIO; ssize_t ret = -ENXIO;
lock_kernel();
bdev = bdget(part_devt(p)); bdev = bdget(part_devt(p));
if (bdev == NULL) if (bdev == NULL)
goto out_unlock_kernel; goto out;
q = blk_trace_get_queue(bdev); q = blk_trace_get_queue(bdev);
if (q == NULL) if (q == NULL)
...@@ -1683,8 +1679,7 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev, ...@@ -1683,8 +1679,7 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
mutex_unlock(&bdev->bd_mutex); mutex_unlock(&bdev->bd_mutex);
out_bdput: out_bdput:
bdput(bdev); bdput(bdev);
out_unlock_kernel: out:
unlock_kernel();
return ret; return ret;
} }
...@@ -1714,11 +1709,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev, ...@@ -1714,11 +1709,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
ret = -ENXIO; ret = -ENXIO;
lock_kernel();
p = dev_to_part(dev); p = dev_to_part(dev);
bdev = bdget(part_devt(p)); bdev = bdget(part_devt(p));
if (bdev == NULL) if (bdev == NULL)
goto out_unlock_kernel; goto out;
q = blk_trace_get_queue(bdev); q = blk_trace_get_queue(bdev);
if (q == NULL) if (q == NULL)
...@@ -1753,8 +1747,6 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev, ...@@ -1753,8 +1747,6 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
mutex_unlock(&bdev->bd_mutex); mutex_unlock(&bdev->bd_mutex);
out_bdput: out_bdput:
bdput(bdev); bdput(bdev);
out_unlock_kernel:
unlock_kernel();
out: out:
return ret ? ret : count; return ret ? ret : count;
} }
......
...@@ -461,6 +461,15 @@ config DEBUG_MUTEXES ...@@ -461,6 +461,15 @@ config DEBUG_MUTEXES
This feature allows mutex semantics violations to be detected and This feature allows mutex semantics violations to be detected and
reported. reported.
config BKL
bool "Big Kernel Lock" if (SMP || PREEMPT)
default y
help
This is the traditional lock that is used in old code instead
of proper locking. All drivers that use the BKL should depend
on this symbol.
Say Y here unless you are working on removing the BKL.
config DEBUG_LOCK_ALLOC config DEBUG_LOCK_ALLOC
bool "Lock debugging: detect incorrect freeing of live locks" bool "Lock debugging: detect incorrect freeing of live locks"
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
config IPX config IPX
tristate "The IPX protocol" tristate "The IPX protocol"
depends on BKL # should be fixable
select LLC select LLC
---help--- ---help---
This is support for the Novell networking protocol, IPX, commonly This is support for the Novell networking protocol, IPX, commonly
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/smp_lock.h>
#include <asm/ioctls.h> #include <asm/ioctls.h>
#include <linux/sunrpc/types.h> #include <linux/sunrpc/types.h>
#include <linux/sunrpc/cache.h> #include <linux/sunrpc/cache.h>
...@@ -1348,15 +1347,10 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) ...@@ -1348,15 +1347,10 @@ static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait)
static long cache_ioctl_procfs(struct file *filp, static long cache_ioctl_procfs(struct file *filp,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
long ret;
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
struct cache_detail *cd = PDE(inode)->data; struct cache_detail *cd = PDE(inode)->data;
lock_kernel(); return cache_ioctl(inode, filp, cmd, arg, cd);
ret = cache_ioctl(inode, filp, cmd, arg, cd);
unlock_kernel();
return ret;
} }
static int cache_open_procfs(struct inode *inode, struct file *filp) static int cache_open_procfs(struct inode *inode, struct file *filp)
...@@ -1555,13 +1549,8 @@ static long cache_ioctl_pipefs(struct file *filp, ...@@ -1555,13 +1549,8 @@ static long cache_ioctl_pipefs(struct file *filp,
{ {
struct inode *inode = filp->f_dentry->d_inode; struct inode *inode = filp->f_dentry->d_inode;
struct cache_detail *cd = RPC_I(inode)->private; struct cache_detail *cd = RPC_I(inode)->private;
long ret;
lock_kernel(); return cache_ioctl(inode, filp, cmd, arg, cd);
ret = cache_ioctl(inode, filp, cmd, arg, cd);
unlock_kernel();
return ret;
} }
static int cache_open_pipefs(struct inode *inode, struct file *filp) static int cache_open_pipefs(struct inode *inode, struct file *filp)
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/sunrpc/rpc_pipe_fs.h> #include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/sunrpc/cache.h> #include <linux/sunrpc/cache.h>
#include <linux/smp_lock.h>
static struct vfsmount *rpc_mount __read_mostly; static struct vfsmount *rpc_mount __read_mostly;
static int rpc_mount_count; static int rpc_mount_count;
...@@ -309,40 +308,33 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) ...@@ -309,40 +308,33 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
return mask; return mask;
} }
static int static long
rpc_pipe_ioctl_unlocked(struct file *filp, unsigned int cmd, unsigned long arg) rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{ {
struct rpc_inode *rpci = RPC_I(filp->f_path.dentry->d_inode); struct inode *inode = filp->f_path.dentry->d_inode;
struct rpc_inode *rpci = RPC_I(inode);
int len; int len;
switch (cmd) { switch (cmd) {
case FIONREAD: case FIONREAD:
if (rpci->ops == NULL) spin_lock(&inode->i_lock);
if (rpci->ops == NULL) {
spin_unlock(&inode->i_lock);
return -EPIPE; return -EPIPE;
}
len = rpci->pipelen; len = rpci->pipelen;
if (filp->private_data) { if (filp->private_data) {
struct rpc_pipe_msg *msg; struct rpc_pipe_msg *msg;
msg = (struct rpc_pipe_msg *)filp->private_data; msg = (struct rpc_pipe_msg *)filp->private_data;
len += msg->len - msg->copied; len += msg->len - msg->copied;
} }
spin_unlock(&inode->i_lock);
return put_user(len, (int __user *)arg); return put_user(len, (int __user *)arg);
default: default:
return -EINVAL; return -EINVAL;
} }
} }
static long
rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
long ret;
lock_kernel();
ret = rpc_pipe_ioctl_unlocked(filp, cmd, arg);
unlock_kernel();
return ret;
}
static const struct file_operations rpc_pipe_fops = { static const struct file_operations rpc_pipe_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.llseek = no_llseek, .llseek = no_llseek,
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
config X25 config X25
tristate "CCITT X.25 Packet Layer (EXPERIMENTAL)" tristate "CCITT X.25 Packet Layer (EXPERIMENTAL)"
depends on EXPERIMENTAL depends on EXPERIMENTAL
depends on BKL # should be fixable
---help--- ---help---
X.25 is a set of standardized network protocols, similar in scope to X.25 is a set of standardized network protocols, similar in scope to
frame relay; the one physical line from your box to the X.25 network frame relay; the one physical line from your box to the X.25 network
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment