aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-02-10 22:09:32 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-01 00:37:16 -0400
commitfb49f864c3c3f8ac5b68563774171fe43634ffeb (patch)
treec10d14ef80f971b73e718333f407cd0ceb51699d /arch/powerpc
parent7a53a4fe707a93a33f6c5d42173bf213cb6ff71d (diff)
powerpc/pmac/smp: Fix 32-bit PowerMac cpu_die
Use generic cpu_state, call idle_task_exit() properly, and remove smp_core99_cpu_die() which isn't useful, the generic function does the job just fine.
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/smp.h1
-rw-r--r--arch/powerpc/platforms/powermac/smp.c25
2 files changed, 6 insertions, 20 deletions
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index a629b6fef882..9fe559785b39 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -45,6 +45,7 @@ extern void fixup_irqs(const struct cpumask *map);
45int generic_cpu_disable(void); 45int generic_cpu_disable(void);
46void generic_cpu_die(unsigned int cpu); 46void generic_cpu_die(unsigned int cpu);
47void generic_mach_cpu_die(void); 47void generic_mach_cpu_die(void);
48DECLARE_PER_CPU(int, cpu_state);
48#endif 49#endif
49 50
50#ifdef CONFIG_PPC64 51#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index ebd2b7e037f0..e0ac7bb77f29 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -880,31 +880,17 @@ int smp_core99_cpu_disable(void)
880 return 0; 880 return 0;
881} 881}
882 882
883static int cpu_dead[NR_CPUS];
884
885void pmac32_cpu_die(void) 883void pmac32_cpu_die(void)
886{ 884{
887 local_irq_disable(); 885 local_irq_disable();
888 cpu_dead[smp_processor_id()] = 1; 886 idle_task_exit();
887 printk(KERN_DEBUG "CPU%d offline\n", smp_processor_id());
888 __get_cpu_var(cpu_state) = CPU_DEAD;
889 smp_wmb();
889 mb(); 890 mb();
890 low_cpu_die(); 891 low_cpu_die();
891} 892}
892 893
893void smp_core99_cpu_die(unsigned int cpu)
894{
895 int timeout;
896
897 timeout = 1000;
898 while (!cpu_dead[cpu]) {
899 if (--timeout == 0) {
900 printk("CPU %u refused to die!\n", cpu);
901 break;
902 }
903 msleep(1);
904 }
905 cpu_dead[cpu] = 0;
906}
907
908#endif /* CONFIG_HOTPLUG_CPU && CONFIG_PP32 */ 894#endif /* CONFIG_HOTPLUG_CPU && CONFIG_PP32 */
909 895
910/* Core99 Macs (dual G4s and G5s) */ 896/* Core99 Macs (dual G4s and G5s) */
@@ -918,12 +904,11 @@ struct smp_ops_t core99_smp_ops = {
918#if defined(CONFIG_HOTPLUG_CPU) 904#if defined(CONFIG_HOTPLUG_CPU)
919# if defined(CONFIG_PPC32) 905# if defined(CONFIG_PPC32)
920 .cpu_disable = smp_core99_cpu_disable, 906 .cpu_disable = smp_core99_cpu_disable,
921 .cpu_die = smp_core99_cpu_die,
922# endif 907# endif
923# if defined(CONFIG_PPC64) 908# if defined(CONFIG_PPC64)
924 .cpu_disable = generic_cpu_disable, 909 .cpu_disable = generic_cpu_disable,
925 .cpu_die = generic_cpu_die,
926# endif 910# endif
911 .cpu_die = generic_cpu_die,
927#endif 912#endif
928}; 913};
929 914