|
|
@@ -875,15 +875,17 @@ static int rtas_cpu_state_change_mask(enum rtas_cpu_state state,
|
|
|
return 0;
|
|
|
|
|
|
for_each_cpu(cpu, cpus) {
|
|
|
+ struct device *dev = get_cpu_device(cpu);
|
|
|
+
|
|
|
switch (state) {
|
|
|
case DOWN:
|
|
|
- cpuret = cpu_down(cpu);
|
|
|
+ cpuret = device_offline(dev);
|
|
|
break;
|
|
|
case UP:
|
|
|
- cpuret = cpu_up(cpu);
|
|
|
+ cpuret = device_online(dev);
|
|
|
break;
|
|
|
}
|
|
|
- if (cpuret) {
|
|
|
+ if (cpuret < 0) {
|
|
|
pr_debug("%s: cpu_%s for cpu#%d returned %d.\n",
|
|
|
__func__,
|
|
|
((state == UP) ? "up" : "down"),
|
|
|
@@ -972,6 +974,8 @@ int rtas_ibm_suspend_me(u64 handle)
|
|
|
data.token = rtas_token("ibm,suspend-me");
|
|
|
data.complete = &done;
|
|
|
|
|
|
+ lock_device_hotplug();
|
|
|
+
|
|
|
/* All present CPUs must be online */
|
|
|
cpumask_andnot(offline_mask, cpu_present_mask, cpu_online_mask);
|
|
|
cpuret = rtas_online_cpus_mask(offline_mask);
|
|
|
@@ -1003,6 +1007,7 @@ int rtas_ibm_suspend_me(u64 handle)
|
|
|
__func__);
|
|
|
|
|
|
out:
|
|
|
+ unlock_device_hotplug();
|
|
|
free_cpumask_var(offline_mask);
|
|
|
return atomic_read(&data.error);
|
|
|
}
|