aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/smp.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index d6479f9738f0..a509c5292a67 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -112,10 +112,10 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
112 112
113 /* Fixup atomic count: it exited inside IRQ handler. */ 113 /* Fixup atomic count: it exited inside IRQ handler. */
114 task_thread_info(paca[lcpu].__current)->preempt_count = 0; 114 task_thread_info(paca[lcpu].__current)->preempt_count = 0;
115 115#ifdef CONFIG_HOTPLUG_CPU
116 if (get_cpu_current_state(lcpu) == CPU_STATE_INACTIVE) 116 if (get_cpu_current_state(lcpu) == CPU_STATE_INACTIVE)
117 goto out; 117 goto out;
118 118#endif
119 /* 119 /*
120 * If the RTAS start-cpu token does not exist then presume the 120 * If the RTAS start-cpu token does not exist then presume the
121 * cpu is already spinning. 121 * cpu is already spinning.
@@ -130,7 +130,9 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
130 return 0; 130 return 0;
131 } 131 }
132 132
133#ifdef CONFIG_HOTPLUG_CPU
133out: 134out:
135#endif
134 return 1; 136 return 1;
135} 137}
136 138
@@ -144,16 +146,15 @@ static void __devinit smp_xics_setup_cpu(int cpu)
144 vpa_init(cpu); 146 vpa_init(cpu);
145 147
146 cpumask_clear_cpu(cpu, of_spin_mask); 148 cpumask_clear_cpu(cpu, of_spin_mask);
149#ifdef CONFIG_HOTPLUG_CPU
147 set_cpu_current_state(cpu, CPU_STATE_ONLINE); 150 set_cpu_current_state(cpu, CPU_STATE_ONLINE);
148 set_default_offline_state(cpu); 151 set_default_offline_state(cpu);
149 152#endif
150} 153}
151#endif /* CONFIG_XICS */ 154#endif /* CONFIG_XICS */
152 155
153static void __devinit smp_pSeries_kick_cpu(int nr) 156static void __devinit smp_pSeries_kick_cpu(int nr)
154{ 157{
155 long rc;
156 unsigned long hcpuid;
157 BUG_ON(nr < 0 || nr >= NR_CPUS); 158 BUG_ON(nr < 0 || nr >= NR_CPUS);
158 159
159 if (!smp_startup_cpu(nr)) 160 if (!smp_startup_cpu(nr))
@@ -165,16 +166,20 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
165 * the processor will continue on to secondary_start 166 * the processor will continue on to secondary_start
166 */ 167 */
167 paca[nr].cpu_start = 1; 168 paca[nr].cpu_start = 1;
168 169#ifdef CONFIG_HOTPLUG_CPU
169 set_preferred_offline_state(nr, CPU_STATE_ONLINE); 170 set_preferred_offline_state(nr, CPU_STATE_ONLINE);
170 171
171 if (get_cpu_current_state(nr) == CPU_STATE_INACTIVE) { 172 if (get_cpu_current_state(nr) == CPU_STATE_INACTIVE) {
173 long rc;
174 unsigned long hcpuid;
175
172 hcpuid = get_hard_smp_processor_id(nr); 176 hcpuid = get_hard_smp_processor_id(nr);
173 rc = plpar_hcall_norets(H_PROD, hcpuid); 177 rc = plpar_hcall_norets(H_PROD, hcpuid);
174 if (rc != H_SUCCESS) 178 if (rc != H_SUCCESS)
175 printk(KERN_ERR "Error: Prod to wake up processor %d " 179 printk(KERN_ERR "Error: Prod to wake up processor %d "
176 "Ret= %ld\n", nr, rc); 180 "Ret= %ld\n", nr, rc);
177 } 181 }
182#endif
178} 183}
179 184
180static int smp_pSeries_cpu_bootable(unsigned int nr) 185static int smp_pSeries_cpu_bootable(unsigned int nr)