aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2011-04-21 18:46:21 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-21 18:46:21 -0400
commit9c2853af1fcbe01a123d666aa373e99119148ee6 (patch)
tree0637d31fe5080a2b3bec0dec8102f323b63934a0 /arch/sparc
parentcb1b8209815594613650772eeb889c170107dad4 (diff)
sparc32: probe for cpu info only during startup
We did a cpu_probe() call each time a CPU got online - which only effect was to save latest CPU/FPU info for use by show_cpuinfo(). Use same setup as for sparc64 where we probe for this info during startup, and only once. This allowed us to annotate a few functions __init which again fixed the following section mismatch warnings: WARNING: vmlinux.o(.text+0x65f0): Section mismatch in reference from the function set_cpu_and_fpu() to the (unknown reference) .init.rodata:(unknown) WARNING: vmlinux.o(.text+0x65f8): Section mismatch in reference from the function set_cpu_and_fpu() to the (unknown reference) .init.rodata:(unknown) WARNING: vmlinux.o(.text+0x664c): Section mismatch in reference from the function set_cpu_and_fpu() to the variable .init.rodata:manufacturer_info WARNING: vmlinux.o(.text+0x6650): Section mismatch in reference from the function set_cpu_and_fpu() to the variable .init.rodata:manufacturer_info Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/leon.h1
-rw-r--r--arch/sparc/kernel/cpu.c12
-rw-r--r--arch/sparc/kernel/devices.c2
-rw-r--r--arch/sparc/kernel/leon_smp.c2
-rw-r--r--arch/sparc/kernel/sun4d_smp.c2
-rw-r--r--arch/sparc/kernel/sun4m_smp.c2
6 files changed, 8 insertions, 13 deletions
diff --git a/arch/sparc/include/asm/leon.h b/arch/sparc/include/asm/leon.h
index 31fb2ac77afa..f1598ca255f0 100644
--- a/arch/sparc/include/asm/leon.h
+++ b/arch/sparc/include/asm/leon.h
@@ -343,7 +343,6 @@ extern void leon_smp_done(void);
343extern void leon_boot_cpus(void); 343extern void leon_boot_cpus(void);
344extern int leon_boot_one_cpu(int i); 344extern int leon_boot_one_cpu(int i);
345void leon_init_smp(void); 345void leon_init_smp(void);
346extern void cpu_probe(void);
347extern void cpu_idle(void); 346extern void cpu_idle(void);
348extern void init_IRQ(void); 347extern void init_IRQ(void);
349extern void cpu_panic(void); 348extern void cpu_panic(void);
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index c3483c71aa04..138dbbc8dc84 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -258,7 +258,7 @@ static const char *sparc_fpu_type;
258const char *sparc_pmu_type; 258const char *sparc_pmu_type;
259 259
260 260
261static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers) 261static void __init set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers)
262{ 262{
263 const struct manufacturer_info *manuf; 263 const struct manufacturer_info *manuf;
264 int i; 264 int i;
@@ -434,7 +434,7 @@ const struct seq_operations cpuinfo_op = {
434}; 434};
435 435
436#ifdef CONFIG_SPARC32 436#ifdef CONFIG_SPARC32
437void __cpuinit cpu_probe(void) 437static int __init cpu_type_probe(void)
438{ 438{
439 int psr_impl, psr_vers, fpu_vers; 439 int psr_impl, psr_vers, fpu_vers;
440 int psr; 440 int psr;
@@ -453,8 +453,12 @@ void __cpuinit cpu_probe(void)
453 put_psr(psr); 453 put_psr(psr);
454 454
455 set_cpu_and_fpu(psr_impl, psr_vers, fpu_vers); 455 set_cpu_and_fpu(psr_impl, psr_vers, fpu_vers);
456
457 return 0;
456} 458}
457#else 459#endif /* CONFIG_SPARC32 */
460
461#ifdef CONFIG_SPARC64
458static void __init sun4v_cpu_probe(void) 462static void __init sun4v_cpu_probe(void)
459{ 463{
460 switch (sun4v_chip_type) { 464 switch (sun4v_chip_type) {
@@ -495,6 +499,6 @@ static int __init cpu_type_probe(void)
495 } 499 }
496 return 0; 500 return 0;
497} 501}
502#endif /* CONFIG_SPARC64 */
498 503
499early_initcall(cpu_type_probe); 504early_initcall(cpu_type_probe);
500#endif
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c
index d2eddd6647cd..12aff23beb94 100644
--- a/arch/sparc/kernel/devices.c
+++ b/arch/sparc/kernel/devices.c
@@ -20,7 +20,6 @@
20#include <asm/system.h> 20#include <asm/system.h>
21#include <asm/cpudata.h> 21#include <asm/cpudata.h>
22 22
23extern void cpu_probe(void);
24extern void clock_stop_probe(void); /* tadpole.c */ 23extern void clock_stop_probe(void); /* tadpole.c */
25extern void sun4c_probe_memerr_reg(void); 24extern void sun4c_probe_memerr_reg(void);
26 25
@@ -133,7 +132,6 @@ void __init device_scan(void)
133 } 132 }
134#endif /* !CONFIG_SMP */ 133#endif /* !CONFIG_SMP */
135 134
136 cpu_probe();
137 { 135 {
138 extern void auxio_probe(void); 136 extern void auxio_probe(void);
139 extern void auxio_power_probe(void); 137 extern void auxio_power_probe(void);
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 053eca9f78e9..b4059dbb6d93 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -94,8 +94,6 @@ void __cpuinit leon_callin(void)
94 local_flush_cache_all(); 94 local_flush_cache_all();
95 local_flush_tlb_all(); 95 local_flush_tlb_all();
96 96
97 cpu_probe();
98
99 /* Fix idle thread fields. */ 97 /* Fix idle thread fields. */
100 __asm__ __volatile__("ld [%0], %%g6\n\t" : : "r"(&current_set[cpuid]) 98 __asm__ __volatile__("ld [%0], %%g6\n\t" : : "r"(&current_set[cpuid])
101 : "memory" /* paranoid */); 99 : "memory" /* paranoid */);
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 475d50b96cd0..38423a05ae41 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -80,8 +80,6 @@ void __cpuinit smp4d_callin(void)
80 local_flush_cache_all(); 80 local_flush_cache_all();
81 local_flush_tlb_all(); 81 local_flush_tlb_all();
82 82
83 cpu_probe();
84
85 while ((unsigned long)current_set[cpuid] < PAGE_OFFSET) 83 while ((unsigned long)current_set[cpuid] < PAGE_OFFSET)
86 barrier(); 84 barrier();
87 85
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 58b8d849674c..5545d10d50cd 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -59,8 +59,6 @@ void __cpuinit smp4m_callin(void)
59 local_flush_cache_all(); 59 local_flush_cache_all();
60 local_flush_tlb_all(); 60 local_flush_tlb_all();
61 61
62 cpu_probe();
63
64 /* Fix idle thread fields. */ 62 /* Fix idle thread fields. */
65 __asm__ __volatile__("ld [%0], %%g6\n\t" 63 __asm__ __volatile__("ld [%0], %%g6\n\t"
66 : : "r" (&current_set[cpuid]) 64 : : "r" (&current_set[cpuid])