Commit 673b864f authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  arch/sparc/mm: Use GFP_KERNEL
  MAINTAINERS: Add trailing slash to SBUS path.
  sbus: autoconvert trivial BKL users to private mutex
parents 93b9e9a2 71cd03b0
...@@ -5357,7 +5357,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git ...@@ -5357,7 +5357,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
S: Maintained S: Maintained
F: arch/sparc/ F: arch/sparc/
F: drivers/sbus F: drivers/sbus/
SPARC SERIAL DRIVERS SPARC SERIAL DRIVERS
M: "David S. Miller" <davem@davemloft.net> M: "David S. Miller" <davem@davemloft.net>
......
...@@ -63,7 +63,7 @@ static void __init sbus_iommu_init(struct of_device *op) ...@@ -63,7 +63,7 @@ static void __init sbus_iommu_init(struct of_device *op)
unsigned long *bitmap; unsigned long *bitmap;
unsigned long tmp; unsigned long tmp;
iommu = kmalloc(sizeof(struct iommu_struct), GFP_ATOMIC); iommu = kmalloc(sizeof(struct iommu_struct), GFP_KERNEL);
if (!iommu) { if (!iommu) {
prom_printf("Unable to allocate iommu structure\n"); prom_printf("Unable to allocate iommu structure\n");
prom_halt(); prom_halt();
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/ioport.h> /* request_region */ #include <linux/ioport.h> /* request_region */
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <asm/atomic.h> #include <asm/atomic.h>
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define DRIVER_NAME "d7s" #define DRIVER_NAME "d7s"
#define PFX DRIVER_NAME ": " #define PFX DRIVER_NAME ": "
static DEFINE_MUTEX(d7s_mutex);
static int sol_compat = 0; /* Solaris compatibility mode */ static int sol_compat = 0; /* Solaris compatibility mode */
/* Solaris compatibility flag - /* Solaris compatibility flag -
...@@ -74,7 +75,6 @@ static int d7s_open(struct inode *inode, struct file *f) ...@@ -74,7 +75,6 @@ static int d7s_open(struct inode *inode, struct file *f)
{ {
if (D7S_MINOR != iminor(inode)) if (D7S_MINOR != iminor(inode))
return -ENODEV; return -ENODEV;
cycle_kernel_lock();
atomic_inc(&d7s_users); atomic_inc(&d7s_users);
return 0; return 0;
} }
...@@ -110,7 +110,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -110,7 +110,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (D7S_MINOR != iminor(file->f_path.dentry->d_inode)) if (D7S_MINOR != iminor(file->f_path.dentry->d_inode))
return -ENODEV; return -ENODEV;
lock_kernel(); mutex_lock(&d7s_mutex);
switch (cmd) { switch (cmd) {
case D7SIOCWR: case D7SIOCWR:
/* assign device register values we mask-out D7S_FLIP /* assign device register values we mask-out D7S_FLIP
...@@ -151,7 +151,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -151,7 +151,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
writeb(regs, p->regs); writeb(regs, p->regs);
break; break;
}; };
unlock_kernel(); mutex_unlock(&d7s_mutex);
return error; return error;
} }
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
...@@ -699,7 +698,6 @@ envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -699,7 +698,6 @@ envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static int static int
envctrl_open(struct inode *inode, struct file *file) envctrl_open(struct inode *inode, struct file *file)
{ {
cycle_kernel_lock();
file->private_data = NULL; file->private_data = NULL;
return 0; return 0;
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/fcntl.h> #include <linux/fcntl.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/spinlock.h> #include <linux/spinlock.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/of.h> #include <linux/of.h>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/upa.h> #include <asm/upa.h>
static DEFINE_MUTEX(flash_mutex);
static DEFINE_SPINLOCK(flash_lock); static DEFINE_SPINLOCK(flash_lock);
static struct { static struct {
unsigned long read_base; /* Physical read address */ unsigned long read_base; /* Physical read address */
...@@ -80,7 +81,7 @@ flash_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -80,7 +81,7 @@ flash_mmap(struct file *file, struct vm_area_struct *vma)
static long long static long long
flash_llseek(struct file *file, long long offset, int origin) flash_llseek(struct file *file, long long offset, int origin)
{ {
lock_kernel(); mutex_lock(&flash_mutex);
switch (origin) { switch (origin) {
case 0: case 0:
file->f_pos = offset; file->f_pos = offset;
...@@ -94,10 +95,10 @@ flash_llseek(struct file *file, long long offset, int origin) ...@@ -94,10 +95,10 @@ flash_llseek(struct file *file, long long offset, int origin)
file->f_pos = flash.read_size; file->f_pos = flash.read_size;
break; break;
default: default:
unlock_kernel(); mutex_unlock(&flash_mutex);
return -EINVAL; return -EINVAL;
} }
unlock_kernel(); mutex_unlock(&flash_mutex);
return file->f_pos; return file->f_pos;
} }
...@@ -125,13 +126,13 @@ flash_read(struct file * file, char __user * buf, ...@@ -125,13 +126,13 @@ flash_read(struct file * file, char __user * buf,
static int static int
flash_open(struct inode *inode, struct file *file) flash_open(struct inode *inode, struct file *file)
{ {
lock_kernel(); mutex_lock(&flash_mutex);
if (test_and_set_bit(0, (void *)&flash.busy) != 0) { if (test_and_set_bit(0, (void *)&flash.busy) != 0) {
unlock_kernel(); mutex_unlock(&flash_mutex);
return -EBUSY; return -EBUSY;
} }
unlock_kernel(); mutex_unlock(&flash_mutex);
return 0; return 0;
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -61,6 +61,7 @@ typedef struct openprom_private_data ...@@ -61,6 +61,7 @@ typedef struct openprom_private_data
} DATA; } DATA;
/* ID of the PROM node containing all of the EEPROM options. */ /* ID of the PROM node containing all of the EEPROM options. */
static DEFINE_MUTEX(openprom_mutex);
static struct device_node *options_node; static struct device_node *options_node;
/* /*
...@@ -316,7 +317,7 @@ static long openprom_sunos_ioctl(struct file * file, ...@@ -316,7 +317,7 @@ static long openprom_sunos_ioctl(struct file * file,
if (bufsize < 0) if (bufsize < 0)
return bufsize; return bufsize;
lock_kernel(); mutex_lock(&openprom_mutex);
switch (cmd) { switch (cmd) {
case OPROMGETOPT: case OPROMGETOPT:
...@@ -367,7 +368,7 @@ static long openprom_sunos_ioctl(struct file * file, ...@@ -367,7 +368,7 @@ static long openprom_sunos_ioctl(struct file * file,
} }
kfree(opp); kfree(opp);
unlock_kernel(); mutex_unlock(&openprom_mutex);
return error; return error;
} }
...@@ -558,7 +559,7 @@ static int openprom_bsd_ioctl(struct file * file, ...@@ -558,7 +559,7 @@ static int openprom_bsd_ioctl(struct file * file,
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int err; int err;
lock_kernel(); mutex_lock(&openprom_mutex);
switch (cmd) { switch (cmd) {
case OPIOCGET: case OPIOCGET:
err = opiocget(argp, data); err = opiocget(argp, data);
...@@ -589,7 +590,7 @@ static int openprom_bsd_ioctl(struct file * file, ...@@ -589,7 +590,7 @@ static int openprom_bsd_ioctl(struct file * file,
err = -EINVAL; err = -EINVAL;
break; break;
}; };
unlock_kernel(); mutex_unlock(&openprom_mutex);
return err; return err;
} }
...@@ -697,11 +698,11 @@ static int openprom_open(struct inode * inode, struct file * file) ...@@ -697,11 +698,11 @@ static int openprom_open(struct inode * inode, struct file * file)
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
lock_kernel(); mutex_lock(&openprom_mutex);
data->current_node = of_find_node_by_path("/"); data->current_node = of_find_node_by_path("/");
data->lastnode = data->current_node; data->lastnode = data->current_node;
file->private_data = (void *) data; file->private_data = (void *) data;
unlock_kernel(); mutex_unlock(&openprom_mutex);
return 0; return 0;
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h> #include <linux/mutex.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
...@@ -72,6 +72,7 @@ struct ts102_regs { ...@@ -72,6 +72,7 @@ struct ts102_regs {
#define UCTRL_STAT_RXNE_STA 0x04 /* receive FIFO not empty status */ #define UCTRL_STAT_RXNE_STA 0x04 /* receive FIFO not empty status */
#define UCTRL_STAT_RXO_STA 0x08 /* receive FIFO overflow status */ #define UCTRL_STAT_RXO_STA 0x08 /* receive FIFO overflow status */
static DEFINE_MUTEX(uctrl_mutex);
static const char *uctrl_extstatus[16] = { static const char *uctrl_extstatus[16] = {
"main power available", "main power available",
"internal battery attached", "internal battery attached",
...@@ -210,10 +211,10 @@ uctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -210,10 +211,10 @@ uctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static int static int
uctrl_open(struct inode *inode, struct file *file) uctrl_open(struct inode *inode, struct file *file)
{ {
lock_kernel(); mutex_lock(&uctrl_mutex);
uctrl_get_event_status(global_driver); uctrl_get_event_status(global_driver);
uctrl_get_external_status(global_driver); uctrl_get_external_status(global_driver);
unlock_kernel(); mutex_unlock(&uctrl_mutex);
return 0; return 0;
} }
......
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