aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/smp.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-02-10 22:03:20 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-01 00:37:21 -0400
commit4c6130d9bba78e7ac44584378660a1204c5297d1 (patch)
tree5e42b54a505afa970c581a9edc89699280a09569 /arch/powerpc/platforms/powermac/smp.c
parent45e07fd045153c0049c99b0cf6cf7254c164d37b (diff)
powerpc/pmac/smp: Consolidate 32-bit and 64-bit PowerMac cpu_die in one file
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac/smp.c')
-rw-r--r--arch/powerpc/platforms/powermac/smp.c58
1 files changed, 55 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index eda470913291..50e15b43ffad 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -865,7 +865,7 @@ static void __devinit smp_core99_setup_cpu(int cpu_nr)
865} 865}
866 866
867 867
868#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32) 868#ifdef CONFIG_HOTPLUG_CPU
869 869
870static int smp_core99_cpu_disable(void) 870static int smp_core99_cpu_disable(void)
871{ 871{
@@ -878,7 +878,9 @@ static int smp_core99_cpu_disable(void)
878 return 0; 878 return 0;
879} 879}
880 880
881void pmac32_cpu_die(void) 881#ifdef CONFIG_PPC32
882
883static void pmac_cpu_die(void)
882{ 884{
883 local_irq_disable(); 885 local_irq_disable();
884 idle_task_exit(); 886 idle_task_exit();
@@ -889,7 +891,52 @@ void pmac32_cpu_die(void)
889 low_cpu_die(); 891 low_cpu_die();
890} 892}
891 893
892#endif /* CONFIG_HOTPLUG_CPU && CONFIG_PP32 */ 894#else /* CONFIG_PPC32 */
895
896static void pmac_cpu_die(void)
897{
898 local_irq_disable();
899 idle_task_exit();
900
901 /*
902 * turn off as much as possible, we'll be
903 * kicked out as this will only be invoked
904 * on core99 platforms for now ...
905 */
906
907 printk(KERN_INFO "CPU#%d offline\n", smp_processor_id());
908 __get_cpu_var(cpu_state) = CPU_DEAD;
909 smp_wmb();
910
911 /*
912 * during the path that leads here preemption is disabled,
913 * reenable it now so that when coming up preempt count is
914 * zero correctly
915 */
916 preempt_enable();
917
918 /*
919 * hard-disable interrupts for the non-NAP case, the NAP code
920 * needs to re-enable interrupts (but soft-disables them)
921 */
922 hard_irq_disable();
923
924 while (1) {
925 /* let's not take timer interrupts too often ... */
926 set_dec(0x7fffffff);
927
928 /* should always be true at this point */
929 if (cpu_has_feature(CPU_FTR_CAN_NAP))
930 power4_cpu_offline_powersave();
931 else {
932 HMT_low();
933 HMT_very_low();
934 }
935 }
936}
937
938#endif /* else CONFIG_PPC32 */
939#endif /* CONFIG_HOTPLUG_CPU */
893 940
894/* Core99 Macs (dual G4s and G5s) */ 941/* Core99 Macs (dual G4s and G5s) */
895struct smp_ops_t core99_smp_ops = { 942struct smp_ops_t core99_smp_ops = {
@@ -933,5 +980,10 @@ void __init pmac_setup_smp(void)
933 smp_ops = &psurge_smp_ops; 980 smp_ops = &psurge_smp_ops;
934 } 981 }
935#endif /* CONFIG_PPC32 */ 982#endif /* CONFIG_PPC32 */
983
984#ifdef CONFIG_HOTPLUG_CPU
985 ppc_md.cpu_die = pmac_cpu_die;
986#endif
936} 987}
937 988
989