Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-08-21 21:12:54 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-08-21 21:13:06 +0200
commitcd0b4ee51a292b56f0ebd37ef14d473b0931b363 (patch)
treec46a5c8ecdaa673ed8770891a912bbe9661e1ff2
parent77397e3de1d1734db096e5dfe945b1eca0406e04 (diff)
powerpc/rtas: use device model APIs and serialization during
LPM (bsc#1144123 ltc#178840). suse-commit: 9cbdd0c19b0296e7edd468b490d0dec90bfe1486
-rw-r--r--arch/powerpc/kernel/rtas.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 497ad7a4772f..e5635fc50e9c 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -874,15 +874,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"),
@@ -971,6 +973,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);
@@ -1010,6 +1014,7 @@ out_hotplug_enable:
__func__);
out:
+ unlock_device_hotplug();
free_cpumask_var(offline_mask);
return atomic_read(&data.error);
}