diff options
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/apm.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/microcode.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/mtrr.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/smp.c | 13 | ||||
-rw-r--r-- | arch/i386/kernel/visws_apic.c | 2 |
5 files changed, 17 insertions, 6 deletions
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index a915181a9..bd7c62bdf 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -181,6 +181,7 @@ #include <linux/sched.h> #include <linux/pm.h> #include <linux/kernel.h> +#include <linux/smp_lock.h> #include <asm/system.h> #include <asm/uaccess.h> @@ -1268,6 +1269,7 @@ static int do_release(struct inode * inode, struct file * filp) if (check_apm_user(as, "release")) return 0; filp->private_data = NULL; + lock_kernel(); if (as->standbys_pending > 0) { standbys_pending -= as->standbys_pending; if (standbys_pending <= 0) @@ -1292,6 +1294,7 @@ static int do_release(struct inode * inode, struct file * filp) else as1->next = as->next; } + unlock_kernel(); kfree_s(as, sizeof(*as)); return 0; } diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index c693b2dc2..0519aee0c 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c @@ -147,7 +147,9 @@ static int microcode_open(struct inode *inode, struct file *file) static int microcode_release(struct inode *inode, struct file *file) { + lock_kernel(); clear_bit(MICROCODE_IS_OPEN, µcode_status); + unlock_kernel(); return 0; } diff --git a/arch/i386/kernel/mtrr.c b/arch/i386/kernel/mtrr.c index c0a158694..05b57c93a 100644 --- a/arch/i386/kernel/mtrr.c +++ b/arch/i386/kernel/mtrr.c @@ -251,6 +251,7 @@ #include <asm/mtrr.h> #include <linux/init.h> #include <linux/smp.h> +#include <linux/smp_lock.h> #include <asm/uaccess.h> #include <asm/io.h> @@ -1532,6 +1533,7 @@ static int mtrr_close (struct inode *ino, struct file *file) unsigned int *fcount = file->private_data; if (fcount == NULL) return 0; + lock_kernel(); max = get_num_var_ranges (); for (i = 0; i < max; ++i) { @@ -1541,6 +1543,7 @@ static int mtrr_close (struct inode *ino, struct file *file) --fcount[i]; } } + unlock_kernel(); kfree (fcount); file->private_data = NULL; return 0; diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index e08418fe0..b11b629fe 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -392,6 +392,8 @@ void smp_send_reschedule(int cpu) * Structure and data for smp_call_function(). This is designed to minimise * static memory requirements. It also looks cleaner. */ +static spinlock_t call_lock = SPIN_LOCK_UNLOCKED; + static volatile struct call_data_struct { void (*func) (void *info); void *info; @@ -422,9 +424,8 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, { struct call_data_struct data; int ret, cpus = smp_num_cpus-1; - static spinlock_t lock = SPIN_LOCK_UNLOCKED; - if(cpus == 0) + if (!cpus) return 0; data.func = func; @@ -434,21 +435,21 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, if (wait) atomic_set(&data.finished, 0); - spin_lock_bh(&lock); + spin_lock_bh(&call_lock); call_data = &data; /* Send a message to all other CPUs and wait for them to respond */ send_IPI_allbutself(CALL_FUNCTION_VECTOR); /* Wait for response */ - /* FIXME: lock-up detection, backtrace on lock-up */ - while(atomic_read(&data.started) != cpus) + while (atomic_read(&data.started) != cpus) barrier(); ret = 0; if (wait) while (atomic_read(&data.finished) != cpus) barrier(); - spin_unlock_bh(&lock); + spin_unlock_bh(&call_lock); + return 0; } diff --git a/arch/i386/kernel/visws_apic.c b/arch/i386/kernel/visws_apic.c index 288f83e8f..017b8eb58 100644 --- a/arch/i386/kernel/visws_apic.c +++ b/arch/i386/kernel/visws_apic.c @@ -91,6 +91,8 @@ static void disable_cobalt_irq(unsigned int irq); static void startup_cobalt_irq(unsigned int irq); #define shutdown_cobalt_irq disable_cobalt_irq +static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED; + static struct hw_interrupt_type cobalt_irq_type = { "Cobalt-APIC", startup_cobalt_irq, |