aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-08 18:39:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-08 18:39:30 -0400
commit98d86c091534f35c4bab294451ae6bccab8e9075 (patch)
tree98c9f0b80bb078405cf173f1d5cc91c72e77082d
parentd875a4b0ffad754e6d89fa561ea7dcdd79c9508b (diff)
parent4d084617fb0d025c42c242362d1f27d337e2d407 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts: arch/sparc/kernel/of_device.c
-rw-r--r--arch/sparc/Makefile8
-rw-r--r--arch/sparc/boot/Makefile6
-rw-r--r--arch/sparc/include/asm/smp_32.h25
-rw-r--r--arch/sparc/kernel/of_device.c19
-rw-r--r--arch/sparc/kernel/sun4d_smp.c16
-rw-r--r--arch/sparc/kernel/sun4m_smp.c12
-rw-r--r--arch/sparc64/Kconfig1
-rw-r--r--arch/sparc64/kernel/of_device.c20
-rw-r--r--arch/sparc64/kernel/smp.c14
-rw-r--r--arch/sparc64/mm/init.c2
10 files changed, 81 insertions, 42 deletions
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 6668e6037af6..9592889a6fd0 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -52,20 +52,24 @@ endif
52export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y kallsyms.o 52export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y kallsyms.o
53 53
54# Default target 54# Default target
55all: image 55all: zImage
56 56
57boot := arch/sparc/boot 57boot := arch/sparc/boot
58 58
59image tftpboot.img: vmlinux 59image zImage tftpboot.img: vmlinux
60 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 60 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
61 61
62archclean: 62archclean:
63 $(Q)$(MAKE) $(clean)=$(boot) 63 $(Q)$(MAKE) $(clean)=$(boot)
64 64
65# This is the image used for packaging
66KBUILD_IMAGE := $(boot)/zImage
67
65CLEAN_FILES += arch/$(ARCH)/boot/System.map 68CLEAN_FILES += arch/$(ARCH)/boot/System.map
66 69
67# Don't use tabs in echo arguments. 70# Don't use tabs in echo arguments.
68define archhelp 71define archhelp
69 echo '* image - kernel image ($(boot)/image)' 72 echo '* image - kernel image ($(boot)/image)'
73 echo '* zImage - stripped kernel image ($(boot)/zImage)'
70 echo ' tftpboot.img - image prepared for tftp' 74 echo ' tftpboot.img - image prepared for tftp'
71endef 75endef
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
index 22d331e1e941..3e77a9f52248 100644
--- a/arch/sparc/boot/Makefile
+++ b/arch/sparc/boot/Makefile
@@ -19,6 +19,9 @@ quiet_cmd_sysmap = SYSMAP $(obj)/System.map
19 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap 19 cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
20quiet_cmd_image = LD $@ 20quiet_cmd_image = LD $@
21 cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@ 21 cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@
22quiet_cmd_strip = STRIP $@
23 cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $(obj)/image -o $@
24
22 25
23define rule_image 26define rule_image
24 $(if $($(quiet)cmd_image), \ 27 $(if $($(quiet)cmd_image), \
@@ -49,6 +52,9 @@ LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
49$(obj)/image: $(obj)/btfix.o FORCE 52$(obj)/image: $(obj)/btfix.o FORCE
50 $(call if_changed_rule,image) 53 $(call if_changed_rule,image)
51 54
55$(obj)/zImage: $(obj)/image
56 $(call if_changed,strip)
57
52$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE 58$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE
53 $(call if_changed,elftoaout) 59 $(call if_changed,elftoaout)
54 $(call if_changed,piggy) 60 $(call if_changed,piggy)
diff --git a/arch/sparc/include/asm/smp_32.h b/arch/sparc/include/asm/smp_32.h
index 7201752cf934..a8180e546a48 100644
--- a/arch/sparc/include/asm/smp_32.h
+++ b/arch/sparc/include/asm/smp_32.h
@@ -50,27 +50,24 @@ struct seq_file;
50void smp_bogo(struct seq_file *); 50void smp_bogo(struct seq_file *);
51void smp_info(struct seq_file *); 51void smp_info(struct seq_file *);
52 52
53BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) 53BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, cpumask_t, unsigned long, unsigned long, unsigned long, unsigned long)
54BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) 54BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void)
55BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) 55BTFIXUPDEF_BLACKBOX(hard_smp_processor_id)
56BTFIXUPDEF_BLACKBOX(load_current) 56BTFIXUPDEF_BLACKBOX(load_current)
57 57
58#define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) 58#define smp_cross_call(func,mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4)
59 59
60static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } 60static inline void xc0(smpfunc_t func) { smp_cross_call(func, cpu_online_map, 0, 0, 0, 0); }
61static inline void xc1(smpfunc_t func, unsigned long arg1) 61static inline void xc1(smpfunc_t func, unsigned long arg1)
62{ smp_cross_call(func, arg1, 0, 0, 0, 0); } 62{ smp_cross_call(func, cpu_online_map, arg1, 0, 0, 0); }
63static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2) 63static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2)
64{ smp_cross_call(func, arg1, arg2, 0, 0, 0); } 64{ smp_cross_call(func, cpu_online_map, arg1, arg2, 0, 0); }
65static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2, 65static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2,
66 unsigned long arg3) 66 unsigned long arg3)
67{ smp_cross_call(func, arg1, arg2, arg3, 0, 0); } 67{ smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, 0); }
68static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2, 68static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2,
69 unsigned long arg3, unsigned long arg4) 69 unsigned long arg3, unsigned long arg4)
70{ smp_cross_call(func, arg1, arg2, arg3, arg4, 0); } 70{ smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, arg4); }
71static inline void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg2,
72 unsigned long arg3, unsigned long arg4, unsigned long arg5)
73{ smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); }
74 71
75static inline int smp_call_function(void (*func)(void *info), void *info, int wait) 72static inline int smp_call_function(void (*func)(void *info), void *info, int wait)
76{ 73{
@@ -78,6 +75,14 @@ static inline int smp_call_function(void (*func)(void *info), void *info, int wa
78 return 0; 75 return 0;
79} 76}
80 77
78static inline int smp_call_function_single(int cpuid, void (*func) (void *info),
79 void *info, int wait)
80{
81 smp_cross_call((smpfunc_t)func, cpumask_of_cpu(cpuid),
82 (unsigned long) info, 0, 0, 0);
83 return 0;
84}
85
81static inline int cpu_logical_map(int cpu) 86static inline int cpu_logical_map(int cpu)
82{ 87{
83 return cpu; 88 return cpu;
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index 4ef160755881..c88af7efc335 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -93,7 +93,7 @@ struct of_bus {
93 int *addrc, int *sizec); 93 int *addrc, int *sizec);
94 int (*map)(u32 *addr, const u32 *range, 94 int (*map)(u32 *addr, const u32 *range,
95 int na, int ns, int pna); 95 int na, int ns, int pna);
96 unsigned int (*get_flags)(const u32 *addr); 96 unsigned long (*get_flags)(const u32 *addr, unsigned long);
97}; 97};
98 98
99/* 99/*
@@ -153,8 +153,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
153 return 0; 153 return 0;
154} 154}
155 155
156static unsigned int of_bus_default_get_flags(const u32 *addr) 156static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
157{ 157{
158 if (flags)
159 return flags;
158 return IORESOURCE_MEM; 160 return IORESOURCE_MEM;
159} 161}
160 162
@@ -217,17 +219,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
217 return 0; 219 return 0;
218} 220}
219 221
220static unsigned int of_bus_pci_get_flags(const u32 *addr) 222static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
221{ 223{
222 unsigned int flags = 0;
223 u32 w = addr[0]; 224 u32 w = addr[0];
224 225
226 /* For PCI, we override whatever child busses may have used. */
227 flags = 0;
225 switch((w >> 24) & 0x03) { 228 switch((w >> 24) & 0x03) {
226 case 0x01: 229 case 0x01:
227 flags |= IORESOURCE_IO; 230 flags |= IORESOURCE_IO;
231 break;
232
228 case 0x02: /* 32 bits */ 233 case 0x02: /* 32 bits */
229 case 0x03: /* 64 bits */ 234 case 0x03: /* 64 bits */
230 flags |= IORESOURCE_MEM; 235 flags |= IORESOURCE_MEM;
236 break;
231 } 237 }
232 if (w & 0x40000000) 238 if (w & 0x40000000)
233 flags |= IORESOURCE_PREFETCH; 239 flags |= IORESOURCE_PREFETCH;
@@ -406,10 +412,11 @@ static void __init build_device_resources(struct of_device *op,
406 int pna, pns; 412 int pna, pns;
407 413
408 size = of_read_addr(reg + na, ns); 414 size = of_read_addr(reg + na, ns);
409 flags = bus->get_flags(reg);
410 415
411 memcpy(addr, reg, na * 4); 416 memcpy(addr, reg, na * 4);
412 417
418 flags = bus->get_flags(reg, 0);
419
413 if (use_1to1_mapping(pp)) { 420 if (use_1to1_mapping(pp)) {
414 result = of_read_addr(addr, na); 421 result = of_read_addr(addr, na);
415 goto build_res; 422 goto build_res;
@@ -434,6 +441,8 @@ static void __init build_device_resources(struct of_device *op,
434 dna, dns, pna)) 441 dna, dns, pna))
435 break; 442 break;
436 443
444 flags = pbus->get_flags(addr, flags);
445
437 dna = pna; 446 dna = pna;
438 dns = pns; 447 dns = pns;
439 dbus = pbus; 448 dbus = pbus;
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index bf7147a9308e..72fa8daab60b 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -261,8 +261,9 @@ static struct smp_funcall {
261static DEFINE_SPINLOCK(cross_call_lock); 261static DEFINE_SPINLOCK(cross_call_lock);
262 262
263/* Cross calls must be serialized, at least currently. */ 263/* Cross calls must be serialized, at least currently. */
264void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, 264static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
265 unsigned long arg3, unsigned long arg4, unsigned long arg5) 265 unsigned long arg2, unsigned long arg3,
266 unsigned long arg4)
266{ 267{
267 if(smp_processors_ready) { 268 if(smp_processors_ready) {
268 register int high = smp_highest_cpu; 269 register int high = smp_highest_cpu;
@@ -277,7 +278,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
277 register unsigned long a2 asm("i2") = arg2; 278 register unsigned long a2 asm("i2") = arg2;
278 register unsigned long a3 asm("i3") = arg3; 279 register unsigned long a3 asm("i3") = arg3;
279 register unsigned long a4 asm("i4") = arg4; 280 register unsigned long a4 asm("i4") = arg4;
280 register unsigned long a5 asm("i5") = arg5; 281 register unsigned long a5 asm("i5") = 0;
281 282
282 __asm__ __volatile__( 283 __asm__ __volatile__(
283 "std %0, [%6]\n\t" 284 "std %0, [%6]\n\t"
@@ -289,11 +290,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
289 290
290 /* Init receive/complete mapping, plus fire the IPI's off. */ 291 /* Init receive/complete mapping, plus fire the IPI's off. */
291 { 292 {
292 cpumask_t mask;
293 register int i; 293 register int i;
294 294
295 mask = cpumask_of_cpu(hard_smp4d_processor_id()); 295 cpu_clear(smp_processor_id(), mask);
296 cpus_andnot(mask, cpu_online_map, mask); 296 cpus_and(mask, cpu_online_map, mask);
297 for(i = 0; i <= high; i++) { 297 for(i = 0; i <= high; i++) {
298 if (cpu_isset(i, mask)) { 298 if (cpu_isset(i, mask)) {
299 ccall_info.processors_in[i] = 0; 299 ccall_info.processors_in[i] = 0;
@@ -308,12 +308,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
308 308
309 i = 0; 309 i = 0;
310 do { 310 do {
311 if (!cpu_isset(i, mask))
312 continue;
311 while(!ccall_info.processors_in[i]) 313 while(!ccall_info.processors_in[i])
312 barrier(); 314 barrier();
313 } while(++i <= high); 315 } while(++i <= high);
314 316
315 i = 0; 317 i = 0;
316 do { 318 do {
319 if (!cpu_isset(i, mask))
320 continue;
317 while(!ccall_info.processors_out[i]) 321 while(!ccall_info.processors_out[i])
318 barrier(); 322 barrier();
319 } while(++i <= high); 323 } while(++i <= high);
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 406ac1abc83a..a14a76ac7f36 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -244,9 +244,9 @@ static struct smp_funcall {
244static DEFINE_SPINLOCK(cross_call_lock); 244static DEFINE_SPINLOCK(cross_call_lock);
245 245
246/* Cross calls must be serialized, at least currently. */ 246/* Cross calls must be serialized, at least currently. */
247static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, 247static void smp4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1,
248 unsigned long arg2, unsigned long arg3, 248 unsigned long arg2, unsigned long arg3,
249 unsigned long arg4, unsigned long arg5) 249 unsigned long arg4)
250{ 250{
251 register int ncpus = SUN4M_NCPUS; 251 register int ncpus = SUN4M_NCPUS;
252 unsigned long flags; 252 unsigned long flags;
@@ -259,14 +259,14 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
259 ccall_info.arg2 = arg2; 259 ccall_info.arg2 = arg2;
260 ccall_info.arg3 = arg3; 260 ccall_info.arg3 = arg3;
261 ccall_info.arg4 = arg4; 261 ccall_info.arg4 = arg4;
262 ccall_info.arg5 = arg5; 262 ccall_info.arg5 = 0;
263 263
264 /* Init receive/complete mapping, plus fire the IPI's off. */ 264 /* Init receive/complete mapping, plus fire the IPI's off. */
265 { 265 {
266 cpumask_t mask = cpu_online_map;
267 register int i; 266 register int i;
268 267
269 cpu_clear(smp_processor_id(), mask); 268 cpu_clear(smp_processor_id(), mask);
269 cpus_and(mask, cpu_online_map, mask);
270 for(i = 0; i < ncpus; i++) { 270 for(i = 0; i < ncpus; i++) {
271 if (cpu_isset(i, mask)) { 271 if (cpu_isset(i, mask)) {
272 ccall_info.processors_in[i] = 0; 272 ccall_info.processors_in[i] = 0;
@@ -284,12 +284,16 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
284 284
285 i = 0; 285 i = 0;
286 do { 286 do {
287 if (!cpu_isset(i, mask))
288 continue;
287 while(!ccall_info.processors_in[i]) 289 while(!ccall_info.processors_in[i])
288 barrier(); 290 barrier();
289 } while(++i < ncpus); 291 } while(++i < ncpus);
290 292
291 i = 0; 293 i = 0;
292 do { 294 do {
295 if (!cpu_isset(i, mask))
296 continue;
293 while(!ccall_info.processors_out[i]) 297 while(!ccall_info.processors_out[i])
294 barrier(); 298 barrier();
295 } while(++i < ncpus); 299 } while(++i < ncpus);
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 4a90809b40fb..5446e2a499b1 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -254,6 +254,7 @@ endmenu
254 254
255config NUMA 255config NUMA
256 bool "NUMA support" 256 bool "NUMA support"
257 depends on SMP
257 258
258config NODES_SHIFT 259config NODES_SHIFT
259 int 260 int
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index c15bcdf75c0d..5c4fbc23aeea 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -119,7 +119,7 @@ struct of_bus {
119 int *addrc, int *sizec); 119 int *addrc, int *sizec);
120 int (*map)(u32 *addr, const u32 *range, 120 int (*map)(u32 *addr, const u32 *range,
121 int na, int ns, int pna); 121 int na, int ns, int pna);
122 unsigned int (*get_flags)(const u32 *addr); 122 unsigned long (*get_flags)(const u32 *addr, unsigned long);
123}; 123};
124 124
125/* 125/*
@@ -179,8 +179,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
179 return 0; 179 return 0;
180} 180}
181 181
182static unsigned int of_bus_default_get_flags(const u32 *addr) 182static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
183{ 183{
184 if (flags)
185 return flags;
184 return IORESOURCE_MEM; 186 return IORESOURCE_MEM;
185} 187}
186 188
@@ -272,17 +274,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
272 return 0; 274 return 0;
273} 275}
274 276
275static unsigned int of_bus_pci_get_flags(const u32 *addr) 277static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
276{ 278{
277 unsigned int flags = 0;
278 u32 w = addr[0]; 279 u32 w = addr[0];
279 280
281 /* For PCI, we override whatever child busses may have used. */
282 flags = 0;
280 switch((w >> 24) & 0x03) { 283 switch((w >> 24) & 0x03) {
281 case 0x01: 284 case 0x01:
282 flags |= IORESOURCE_IO; 285 flags |= IORESOURCE_IO;
286 break;
287
283 case 0x02: /* 32 bits */ 288 case 0x02: /* 32 bits */
284 case 0x03: /* 64 bits */ 289 case 0x03: /* 64 bits */
285 flags |= IORESOURCE_MEM; 290 flags |= IORESOURCE_MEM;
291 break;
286 } 292 }
287 if (w & 0x40000000) 293 if (w & 0x40000000)
288 flags |= IORESOURCE_PREFETCH; 294 flags |= IORESOURCE_PREFETCH;
@@ -510,10 +516,10 @@ static void __init build_device_resources(struct of_device *op,
510 int pna, pns; 516 int pna, pns;
511 517
512 size = of_read_addr(reg + na, ns); 518 size = of_read_addr(reg + na, ns);
513 flags = bus->get_flags(reg);
514
515 memcpy(addr, reg, na * 4); 519 memcpy(addr, reg, na * 4);
516 520
521 flags = bus->get_flags(addr, 0);
522
517 if (use_1to1_mapping(pp)) { 523 if (use_1to1_mapping(pp)) {
518 result = of_read_addr(addr, na); 524 result = of_read_addr(addr, na);
519 goto build_res; 525 goto build_res;
@@ -538,6 +544,8 @@ static void __init build_device_resources(struct of_device *op,
538 dna, dns, pna)) 544 dna, dns, pna))
539 break; 545 break;
540 546
547 flags = pbus->get_flags(addr, flags);
548
541 dna = pna; 549 dna = pna;
542 dns = pns; 550 dns = pns;
543 dbus = pbus; 551 dbus = pbus;
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 743ccad61c60..2be166c544ca 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -80,8 +80,6 @@ void smp_bogo(struct seq_file *m)
80 i, cpu_data(i).clock_tick); 80 i, cpu_data(i).clock_tick);
81} 81}
82 82
83static __cacheline_aligned_in_smp DEFINE_SPINLOCK(call_lock);
84
85extern void setup_sparc64_timer(void); 83extern void setup_sparc64_timer(void);
86 84
87static volatile unsigned long callin_flag = 0; 85static volatile unsigned long callin_flag = 0;
@@ -120,9 +118,9 @@ void __cpuinit smp_callin(void)
120 while (!cpu_isset(cpuid, smp_commenced_mask)) 118 while (!cpu_isset(cpuid, smp_commenced_mask))
121 rmb(); 119 rmb();
122 120
123 spin_lock(&call_lock); 121 ipi_call_lock();
124 cpu_set(cpuid, cpu_online_map); 122 cpu_set(cpuid, cpu_online_map);
125 spin_unlock(&call_lock); 123 ipi_call_unlock();
126 124
127 /* idle thread is expected to have preempt disabled */ 125 /* idle thread is expected to have preempt disabled */
128 preempt_disable(); 126 preempt_disable();
@@ -1305,10 +1303,6 @@ int __cpu_disable(void)
1305 c->core_id = 0; 1303 c->core_id = 0;
1306 c->proc_id = -1; 1304 c->proc_id = -1;
1307 1305
1308 spin_lock(&call_lock);
1309 cpu_clear(cpu, cpu_online_map);
1310 spin_unlock(&call_lock);
1311
1312 smp_wmb(); 1306 smp_wmb();
1313 1307
1314 /* Make sure no interrupts point to this cpu. */ 1308 /* Make sure no interrupts point to this cpu. */
@@ -1318,6 +1312,10 @@ int __cpu_disable(void)
1318 mdelay(1); 1312 mdelay(1);
1319 local_irq_disable(); 1313 local_irq_disable();
1320 1314
1315 ipi_call_lock();
1316 cpu_clear(cpu, cpu_online_map);
1317 ipi_call_unlock();
1318
1321 return 0; 1319 return 0;
1322} 1320}
1323 1321
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 7c3c81f60a6e..4fb9de00fc8a 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -1875,7 +1875,7 @@ static int pavail_rescan_ents __initdata;
1875 * memory list again, and make sure it provides at least as much 1875 * memory list again, and make sure it provides at least as much
1876 * memory as 'pavail' does. 1876 * memory as 'pavail' does.
1877 */ 1877 */
1878static void setup_valid_addr_bitmap_from_pavail(void) 1878static void __init setup_valid_addr_bitmap_from_pavail(void)
1879{ 1879{
1880 int i; 1880 int i;
1881 1881