|
@@ -154,30 +154,6 @@ static void pseries_mach_cpu_die(void)
|
|
|
for(;;);
|
|
|
}
|
|
|
|
|
|
-static int qcss_tok; /* query-cpu-stopped-state token */
|
|
|
-
|
|
|
-/* Get state of physical CPU.
|
|
|
- * Return codes:
|
|
|
- * 0 - The processor is in the RTAS stopped state
|
|
|
- * 1 - stop-self is in progress
|
|
|
- * 2 - The processor is not in the RTAS stopped state
|
|
|
- * -1 - Hardware Error
|
|
|
- * -2 - Hardware Busy, Try again later.
|
|
|
- */
|
|
|
-static int query_cpu_stopped(unsigned int pcpu)
|
|
|
-{
|
|
|
- int cpu_status, status;
|
|
|
-
|
|
|
- status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
|
|
|
- if (status != 0) {
|
|
|
- printk(KERN_ERR
|
|
|
- "RTAS query-cpu-stopped-state failed: %i\n", status);
|
|
|
- return status;
|
|
|
- }
|
|
|
-
|
|
|
- return cpu_status;
|
|
|
-}
|
|
|
-
|
|
|
static int pseries_cpu_disable(void)
|
|
|
{
|
|
|
int cpu = smp_processor_id();
|
|
@@ -224,8 +200,9 @@ static void pseries_cpu_die(unsigned int cpu)
|
|
|
} else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) {
|
|
|
|
|
|
for (tries = 0; tries < 25; tries++) {
|
|
|
- cpu_status = query_cpu_stopped(pcpu);
|
|
|
- if (cpu_status == 0 || cpu_status == -1)
|
|
|
+ cpu_status = smp_query_cpu_stopped(pcpu);
|
|
|
+ if (cpu_status == QCSS_STOPPED ||
|
|
|
+ cpu_status == QCSS_HARDWARE_ERROR)
|
|
|
break;
|
|
|
cpu_relax();
|
|
|
}
|
|
@@ -388,6 +365,7 @@ static int __init pseries_cpu_hotplug_init(void)
|
|
|
struct device_node *np;
|
|
|
const char *typep;
|
|
|
int cpu;
|
|
|
+ int qcss_tok;
|
|
|
|
|
|
for_each_node_by_name(np, "interrupt-controller") {
|
|
|
typep = of_get_property(np, "compatible", NULL);
|