sparc64: Fix NMI startup bug which also breaks perf.
authorDavid S. Miller <davem@davemloft.net>
Tue, 15 Feb 2011 23:04:07 +0000 (15:04 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Feb 2011 23:04:07 +0000 (15:04 -0800)
Doing NMI startup as an early initcall doesn't work because we need
to have SMP started up by then.

So we'd only NMI startup one cpu, which causes perf PMU grab to
BUG because the nmi_active count isn't what it's supposed to be.

This also points out that we don't have proper CPU up/down notifiers
for the NMI code which will need to be fixed at some point.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/pcr.h
arch/sparc/kernel/pcr.c
arch/sparc/kernel/smp_64.c

index a2f5c61f924e150e059b94f06705984dafa51dd4..843e4faf6a507fe8291e44c947794ba837e3376b 100644 (file)
@@ -43,4 +43,6 @@ static inline u64 picl_value(unsigned int nmi_hz)
 
 extern u64 pcr_enable;
 
+extern int pcr_arch_init(void);
+
 #endif /* __PCR_H */
index ae96cf52a955c71b74395f0e5f06b10f64186e63..7c2ced612b8f5ee33d265b2f316df72fe8825769 100644 (file)
@@ -167,5 +167,3 @@ out_unregister:
        unregister_perf_hsvc();
        return err;
 }
-
-early_initcall(pcr_arch_init);
index b6a2b8f47040b2eb6d5f8fdf82ad2c696d9fe733..555a76d1f4a18f6d490a978cfd26694e6c115eb6 100644 (file)
@@ -49,6 +49,7 @@
 #include <asm/mdesc.h>
 #include <asm/ldc.h>
 #include <asm/hypervisor.h>
+#include <asm/pcr.h>
 
 #include "cpumap.h"
 
@@ -1358,6 +1359,7 @@ void __cpu_die(unsigned int cpu)
 
 void __init smp_cpus_done(unsigned int max_cpus)
 {
+       pcr_arch_init();
 }
 
 void smp_send_reschedule(int cpu)