aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-07 13:59:33 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-12-07 13:59:33 -0500
commitf3656b9a2740ebdff123b30b6b806648c9f189f8 (patch)
tree19f15333cfb031a732b12369eca5187afec0ed45 /arch
parentbbce0b5ca2884b44dbfffff77e876a90b4184516 (diff)
parentb332b8bc9c67165eabdfc7d10b4a2e4cc9f937d0 (diff)
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.c16
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 @@
1/* $Id: chmc.c,v 1.4 2002/01/08 16:00:14 davem Exp $ 1/* memctrlr.c: Driver for UltraSPARC-III memory controller.
2 * memctrlr.c: Driver for UltraSPARC-III memory controller.
3 * 2 *
4 * Copyright (C) 2001 David S. Miller (davem@redhat.com) 3 * Copyright (C) 2001, 2007 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5
7#include <linux/module.h> 6#include <linux/module.h>
@@ -16,6 +15,7 @@
16#include <linux/init.h> 15#include <linux/init.h>
17#include <asm/spitfire.h> 16#include <asm/spitfire.h>
18#include <asm/chmctrl.h> 17#include <asm/chmctrl.h>
18#include <asm/cpudata.h>
19#include <asm/oplib.h> 19#include <asm/oplib.h>
20#include <asm/prom.h> 20#include <asm/prom.h>
21#include <asm/io.h> 21#include <asm/io.h>
@@ -242,8 +242,11 @@ int chmc_getunumber(int syndrome_code,
242 */ 242 */
243static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset) 243static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset)
244{ 244{
245 unsigned long ret; 245 unsigned long ret, this_cpu;
246 int this_cpu = get_cpu(); 246
247 preempt_disable();
248
249 this_cpu = real_hard_smp_processor_id();
247 250
248 if (mp->portid == this_cpu) { 251 if (mp->portid == this_cpu) {
249 __asm__ __volatile__("ldxa [%1] %2, %0" 252 __asm__ __volatile__("ldxa [%1] %2, %0"
@@ -255,7 +258,8 @@ static u64 read_mcreg(struct mctrl_info *mp, unsigned long offset)
255 : "r" (mp->regs + offset), 258 : "r" (mp->regs + offset),
256 "i" (ASI_PHYS_BYPASS_EC_E)); 259 "i" (ASI_PHYS_BYPASS_EC_E));
257 } 260 }
258 put_cpu(); 261
262 preempt_enable();
259 263
260 return ret; 264 return ret;
261} 265}