diff options
author | Dan Streetman <ddstreet@ieee.org> | 2014-10-31 15:41:34 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2014-11-01 19:55:56 -0400 |
commit | 10ccaf178b2b961d8bca252d647ed7ed8aae2a20 (patch) | |
tree | 49c2adaa9a8acb915b490eaf92b52161b396eed6 /arch | |
parent | 325e4114043469e5f9923d902b4d30bcc2be8163 (diff) |
powerpc: use device_online/offline() instead of cpu_up/down()
In powerpc pseries platform dlpar operations, use device_online() and
device_offline() instead of cpu_up() and cpu_down().
Calling cpu_up/down() directly does not update the cpu device offline
field, which is used to online/offline a cpu from sysfs. Calling
device_online/offline() instead keeps the sysfs cpu online value
correct. The hotplug lock, which is required to be held when calling
device_online/offline(), is already held when dlpar_online/offline_cpu()
are called, since they are called only from cpu_probe|release_store().
This patch fixes errors on phyp (PowerVM) systems that have cpu(s)
added/removed using dlpar operations; without this patch, the
/sys/devices/system/cpu/cpuN/online nodes do not correctly show the
online state of added/removed cpus.
Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Fixes: 0902a9044fa5 ("Driver core: Use generic offline/online for CPU offline/online")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/dlpar.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 6ad83bd11fe2..c22bb1b4beb8 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -382,7 +382,7 @@ static int dlpar_online_cpu(struct device_node *dn) | |||
382 | BUG_ON(get_cpu_current_state(cpu) | 382 | BUG_ON(get_cpu_current_state(cpu) |
383 | != CPU_STATE_OFFLINE); | 383 | != CPU_STATE_OFFLINE); |
384 | cpu_maps_update_done(); | 384 | cpu_maps_update_done(); |
385 | rc = cpu_up(cpu); | 385 | rc = device_online(get_cpu_device(cpu)); |
386 | if (rc) | 386 | if (rc) |
387 | goto out; | 387 | goto out; |
388 | cpu_maps_update_begin(); | 388 | cpu_maps_update_begin(); |
@@ -467,7 +467,7 @@ static int dlpar_offline_cpu(struct device_node *dn) | |||
467 | if (get_cpu_current_state(cpu) == CPU_STATE_ONLINE) { | 467 | if (get_cpu_current_state(cpu) == CPU_STATE_ONLINE) { |
468 | set_preferred_offline_state(cpu, CPU_STATE_OFFLINE); | 468 | set_preferred_offline_state(cpu, CPU_STATE_OFFLINE); |
469 | cpu_maps_update_done(); | 469 | cpu_maps_update_done(); |
470 | rc = cpu_down(cpu); | 470 | rc = device_offline(get_cpu_device(cpu)); |
471 | if (rc) | 471 | if (rc) |
472 | goto out; | 472 | goto out; |
473 | cpu_maps_update_begin(); | 473 | cpu_maps_update_begin(); |