Skip to content

Commit

Permalink
Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
Browse files Browse the repository at this point in the history
* 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits)
  IB/umad: BKL is not needed for ib_umad_open()
  IB/uverbs: BKL is not needed for ib_uverbs_open()
  bf561-coreb: BKL unneeded for open()
  Call fasync() functions without the BKL
  snd/PCM: fasync BKL pushdown
  ipmi: fasync BKL pushdown
  ecryptfs: fasync BKL pushdown
  Bluetooth VHCI: fasync BKL pushdown
  tty_io: fasync BKL pushdown
  tun: fasync BKL pushdown
  i2o: fasync BKL pushdown
  mpt: fasync BKL pushdown
  Remove BKL from remote_llseek v2
  Make FAT users happier by not deadlocking
  x86-mce: BKL pushdown
  vmwatchdog: BKL pushdown
  vmcp: BKL pushdown
  via-pmu: BKL pushdown
  uml-random: BKL pushdown
  uml-mmapper: BKL pushdown
  ...
  • Loading branch information
torvalds committed Jul 14, 2008
2 parents a41eeba + 2fceef3 commit d1794f2
Show file tree
Hide file tree
Showing 179 changed files with 1,092 additions and 350 deletions.
1 change: 1 addition & 0 deletions arch/blackfin/mach-bf561/coreb.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static loff_t coreb_lseek(struct file *file, loff_t offset, int origin)
return ret;
}

/* No BKL needed here */
static int coreb_open(struct inode *inode, struct file *file)
{
spin_lock_irq(&coreb_lock);
Expand Down
4 changes: 2 additions & 2 deletions arch/cris/arch-v10/drivers/eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/smp_lock.h>
#include <linux/wait.h>
#include <asm/uaccess.h>
#include "i2c.h"
Expand Down Expand Up @@ -375,10 +376,9 @@ int __init eeprom_init(void)
}

/* Opens the device. */

static int eeprom_open(struct inode * inode, struct file * file)
{

cycle_kernel_lock();
if(iminor(inode) != EEPROM_MINOR_NR)
return -ENXIO;
if(imajor(inode) != EEPROM_MAJOR_NR)
Expand Down
3 changes: 3 additions & 0 deletions arch/cris/arch-v10/drivers/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/smp_lock.h>
#include <linux/string.h>
#include <linux/poll.h>
#include <linux/init.h>
Expand Down Expand Up @@ -323,6 +324,7 @@ gpio_open(struct inode *inode, struct file *filp)
if (!priv)
return -ENOMEM;

lock_kernel();
priv->minor = p;

/* initialize the io/alarm struct */
Expand Down Expand Up @@ -357,6 +359,7 @@ gpio_open(struct inode *inode, struct file *filp)
alarmlist = priv;
spin_unlock_irqrestore(&gpio_lock, flags);

unlock_kernel();
return 0;
}

Expand Down
2 changes: 2 additions & 0 deletions arch/cris/arch-v10/drivers/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
Expand Down Expand Up @@ -566,6 +567,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
static int
i2c_open(struct inode *inode, struct file *filp)
{
cycle_kernel_lock();
return 0;
}

Expand Down
34 changes: 21 additions & 13 deletions arch/cris/arch-v10/drivers/sync_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/timer.h>
#include <asm/irq.h>
#include <asm/dma.h>
Expand Down Expand Up @@ -443,18 +444,21 @@ static int sync_serial_open(struct inode *inode, struct file *file)
int dev = MINOR(inode->i_rdev);
struct sync_port *port;
int mode;
int err = -EBUSY;

lock_kernel();
DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev));

if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) {
DEBUG(printk(KERN_DEBUG "Invalid minor %d\n", dev));
return -ENODEV;
err = -ENODEV;
goto out;
}
port = &ports[dev];
/* Allow open this device twice (assuming one reader and one writer) */
if (port->busy == 2) {
DEBUG(printk(KERN_DEBUG "Device is busy.. \n"));
return -EBUSY;
goto out;
}
if (port->init_irqs) {
if (port->use_dma) {
Expand All @@ -465,14 +469,14 @@ static int sync_serial_open(struct inode *inode, struct file *file)
&ports[0])) {
printk(KERN_CRIT "Can't alloc "
"sync serial port 1 IRQ");
return -EBUSY;
goto out;
} else if (request_irq(25, rx_interrupt, 0,
"synchronous serial 1 dma rx",
&ports[0])) {
free_irq(24, &port[0]);
printk(KERN_CRIT "Can't alloc "
"sync serial port 1 IRQ");
return -EBUSY;
goto out;
} else if (cris_request_dma(8,
"synchronous serial 1 dma tr",
DMA_VERBOSE_ON_ERROR,
Expand All @@ -482,7 +486,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
printk(KERN_CRIT "Can't alloc "
"sync serial port 1 "
"TX DMA channel");
return -EBUSY;
goto out;
} else if (cris_request_dma(9,
"synchronous serial 1 dma rec",
DMA_VERBOSE_ON_ERROR,
Expand All @@ -493,7 +497,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
printk(KERN_CRIT "Can't alloc "
"sync serial port 1 "
"RX DMA channel");
return -EBUSY;
goto out;
}
#endif
RESET_DMA(8); WAIT_DMA(8);
Expand All @@ -520,14 +524,14 @@ static int sync_serial_open(struct inode *inode, struct file *file)
&ports[1])) {
printk(KERN_CRIT "Can't alloc "
"sync serial port 3 IRQ");
return -EBUSY;
goto out;
} else if (request_irq(21, rx_interrupt, 0,
"synchronous serial 3 dma rx",
&ports[1])) {
free_irq(20, &ports[1]);
printk(KERN_CRIT "Can't alloc "
"sync serial port 3 IRQ");
return -EBUSY;
goto out;
} else if (cris_request_dma(4,
"synchronous serial 3 dma tr",
DMA_VERBOSE_ON_ERROR,
Expand All @@ -537,7 +541,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
printk(KERN_CRIT "Can't alloc "
"sync serial port 3 "
"TX DMA channel");
return -EBUSY;
goto out;
} else if (cris_request_dma(5,
"synchronous serial 3 dma rec",
DMA_VERBOSE_ON_ERROR,
Expand All @@ -548,7 +552,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
printk(KERN_CRIT "Can't alloc "
"sync serial port 3 "
"RX DMA channel");
return -EBUSY;
goto out;
}
#endif
RESET_DMA(4); WAIT_DMA(4);
Expand Down Expand Up @@ -581,7 +585,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
&ports[0])) {
printk(KERN_CRIT "Can't alloc "
"sync serial manual irq");
return -EBUSY;
goto out;
}
} else if (port == &ports[1]) {
if (request_irq(8,
Expand All @@ -591,7 +595,7 @@ static int sync_serial_open(struct inode *inode, struct file *file)
&ports[1])) {
printk(KERN_CRIT "Can't alloc "
"sync serial manual irq");
return -EBUSY;
goto out;
}
}
port->init_irqs = 0;
Expand Down Expand Up @@ -620,7 +624,11 @@ static int sync_serial_open(struct inode *inode, struct file *file)
*R_IRQ_MASK1_SET = 1 << port->data_avail_bit;
DEBUG(printk(KERN_DEBUG "sser%d rec started\n", dev));
}
return 0;
ret = 0;

out:
unlock_kernel();
return ret;
}

static int sync_serial_release(struct inode *inode, struct file *file)
Expand Down
3 changes: 2 additions & 1 deletion arch/cris/arch-v32/drivers/cryptocop.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/string.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/smp_lock.h>
#include <linux/spinlock.h>
#include <linux/stddef.h>

Expand Down Expand Up @@ -2302,11 +2303,11 @@ static int cryptocop_job_setup(struct cryptocop_prio_job **pj, struct cryptocop_
return 0;
}


static int cryptocop_open(struct inode *inode, struct file *filp)
{
int p = iminor(inode);

cycle_kernel_lock();
if (p != CRYPTOCOP_MINOR) return -EINVAL;

filp->private_data = NULL;
Expand Down
2 changes: 2 additions & 0 deletions arch/cris/arch-v32/drivers/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/smp_lock.h>

#include <asm/etraxi2c.h>

Expand Down Expand Up @@ -636,6 +637,7 @@ i2c_readreg(unsigned char theSlave, unsigned char theReg)
static int
i2c_open(struct inode *inode, struct file *filp)
{
cycle_kernel_lock();
return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions arch/cris/arch-v32/drivers/mach-a3/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>

#include <asm/etraxgpio.h>
#include <hwregs/reg_map.h>
Expand Down Expand Up @@ -390,6 +391,8 @@ static int gpio_open(struct inode *inode, struct file *filp)

if (!priv)
return -ENOMEM;

lock_kernel();
memset(priv, 0, sizeof(*priv));

priv->minor = p;
Expand All @@ -412,6 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp)
spin_unlock_irq(&gpio_lock);
}

unlock_kernel();
return 0;
}

Expand Down
5 changes: 4 additions & 1 deletion arch/cris/arch-v32/drivers/mach-fs/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/smp_lock.h>

#include <asm/etraxgpio.h>
#include <hwregs/reg_map.h>
Expand Down Expand Up @@ -426,9 +427,10 @@ gpio_open(struct inode *inode, struct file *filp)
return -EINVAL;

priv = kmalloc(sizeof(struct gpio_private), GFP_KERNEL);

if (!priv)
return -ENOMEM;

lock_kernel();
memset(priv, 0, sizeof(*priv));

priv->minor = p;
Expand All @@ -449,6 +451,7 @@ gpio_open(struct inode *inode, struct file *filp)
alarmlist = priv;
spin_unlock_irq(&alarm_lock);

unlock_kernel();
return 0;
}

Expand Down
Loading

0 comments on commit d1794f2

Please sign in to comment.