diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-07 19:59:33 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-07 19:59:33 +0100 |
commit | f3656b9a2740ebdff123b30b6b806648c9f189f8 (patch) | |
tree | 19f15333cfb031a732b12369eca5187afec0ed45 /arch | |
parent | Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds (diff) | |
parent | [SPARC64]: Fix memory controller register access when non-SMP. (diff) | |
download | linux-f3656b9a2740ebdff123b30b6b806648c9f189f8.tar.xz linux-f3656b9a2740ebdff123b30b6b806648c9f189f8.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Fix memory controller register access when non-SMP.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/kernel/chmc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/chmc.c b/arch/sparc64/kernel/chmc.c index 777d34577045..6d4f02e8a4cf 100644 --- a/arch/sparc64/kernel/chmc.c +++ b/arch/sparc64/kernel/chmc.c @@ -1,7 +1,6 @@ -/* $Id: chmc.c,v 1.4 2002/01/08 16:00:14 davem Exp $ - * memctrlr.c: Driver for UltraSPARC-III memory controller. +/* memctrlr.c: Driver for UltraSPARC-III memory controller. * - * Copyright (C) 2001 David S. Miller (davem@redhat.com) + * Copyright (C) 2001, 2007 David S. Miller (davem@davemloft.net) */ #include <linux/module.h> @@ -16,6 +15,7 @@ #include <linux/init.h> #include <asm/spitfire.h> #include <asm/chmctrl.h> +#include <asm/cpudata.h> #include <asm/oplib.h> #include <asm/prom.h> #include <asm/io.h> @@ -242,8 +242,11 @@ int chmc_getunumber(int syndrome_code, */ static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset) { - unsigned long ret; - int this_cpu = get_cpu(); + unsigned long ret, this_cpu; + + preempt_disable(); + + this_cpu = real_hard_smp_processor_id(); if (mp->portid == this_cpu) { __asm__ __volatile__("ldxa [%1] %2, %0" @@ -255,7 +258,8 @@ static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset) : "r" (mp->regs + offset), "i" (ASI_PHYS_BYPASS_EC_E)); } - put_cpu(); + + preempt_enable(); return ret; } |