aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 12864d75126d..e78e8ac95550 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -64,6 +64,8 @@ static void pSeries_mach_cpu_die(void)
64 for(;;); 64 for(;;);
65} 65}
66 66
67static int qcss_tok; /* query-cpu-stopped-state token */
68
67/* Get state of physical CPU. 69/* Get state of physical CPU.
68 * Return codes: 70 * Return codes:
69 * 0 - The processor is in the RTAS stopped state 71 * 0 - The processor is in the RTAS stopped state
@@ -74,12 +76,8 @@ static void pSeries_mach_cpu_die(void)
74 */ 76 */
75static int query_cpu_stopped(unsigned int pcpu) 77static int query_cpu_stopped(unsigned int pcpu)
76{ 78{
77 int cpu_status; 79 int cpu_status, status;
78 int status, qcss_tok;
79 80
80 qcss_tok = rtas_token("query-cpu-stopped-state");
81 if (qcss_tok == RTAS_UNKNOWN_SERVICE)
82 return -1;
83 status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu); 81 status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
84 if (status != 0) { 82 if (status != 0) {
85 printk(KERN_ERR 83 printk(KERN_ERR
@@ -254,9 +252,16 @@ static struct notifier_block pSeries_smp_nb = {
254static int __init pseries_cpu_hotplug_init(void) 252static int __init pseries_cpu_hotplug_init(void)
255{ 253{
256 rtas_stop_self_args.token = rtas_token("stop-self"); 254 rtas_stop_self_args.token = rtas_token("stop-self");
255 qcss_tok = rtas_token("query-cpu-stopped-state");
257 256
258 ppc_md.cpu_die = pSeries_mach_cpu_die; 257 if (rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE ||
258 qcss_tok == RTAS_UNKNOWN_SERVICE) {
259 printk(KERN_INFO "CPU Hotplug not supported by firmware "
260 "- disabling.\n");
261 return 0;
262 }
259 263
264 ppc_md.cpu_die = pSeries_mach_cpu_die;
260 smp_ops->cpu_disable = pSeries_cpu_disable; 265 smp_ops->cpu_disable = pSeries_cpu_disable;
261 smp_ops->cpu_die = pSeries_cpu_die; 266 smp_ops->cpu_die = pSeries_cpu_die;
262 267