diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2014-05-23 17:31:44 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-05-28 11:33:02 -0400 |
commit | 3f8517e7937d04ac7df9082c741fefc9c873065b (patch) | |
tree | 2b70ba0135ae5e33953ffc5273d24e163747077a /arch/arm/common | |
parent | 483a6c9d447f625b991fa04a1530493d893984db (diff) |
ARM: 8063/1: bL_switcher: fix individual online status reporting of removed CPUs
The content of /sys/devices/system/cpu/cpu*/online is still 1 for those
CPUs that the switcher has removed even though the global state in
/sys/devices/system/cpu/online is updated correctly.
It turns out that commit 0902a9044f ("Driver core: Use generic
offline/online for CPU offline/online") has changed the way those files
retrieve their content by relying on on the generic attribute handling
code. The switcher, by calling cpu_down() directly, bypasses this
handling and the attribute value doesn't get updated.
Fix this by calling device_offline()/device_online() instead.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/bL_switcher.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c index f01c0ee0c87e..490f3dced749 100644 --- a/arch/arm/common/bL_switcher.c +++ b/arch/arm/common/bL_switcher.c | |||
@@ -433,8 +433,12 @@ static void bL_switcher_restore_cpus(void) | |||
433 | { | 433 | { |
434 | int i; | 434 | int i; |
435 | 435 | ||
436 | for_each_cpu(i, &bL_switcher_removed_logical_cpus) | 436 | for_each_cpu(i, &bL_switcher_removed_logical_cpus) { |
437 | cpu_up(i); | 437 | struct device *cpu_dev = get_cpu_device(i); |
438 | int ret = device_online(cpu_dev); | ||
439 | if (ret) | ||
440 | dev_err(cpu_dev, "switcher: unable to restore CPU\n"); | ||
441 | } | ||
438 | } | 442 | } |
439 | 443 | ||
440 | static int bL_switcher_halve_cpus(void) | 444 | static int bL_switcher_halve_cpus(void) |
@@ -521,7 +525,7 @@ static int bL_switcher_halve_cpus(void) | |||
521 | continue; | 525 | continue; |
522 | } | 526 | } |
523 | 527 | ||
524 | ret = cpu_down(i); | 528 | ret = device_offline(get_cpu_device(i)); |
525 | if (ret) { | 529 | if (ret) { |
526 | bL_switcher_restore_cpus(); | 530 | bL_switcher_restore_cpus(); |
527 | return ret; | 531 | return ret; |