]> git.baikalelectronics.ru Git - kernel.git/commit
cpu/hotplug: Allow suspend/resume CPU to be specified
authorJames Morse <james.morse@arm.com>
Wed, 17 Aug 2016 12:50:25 +0000 (13:50 +0100)
committerWill Deacon <will.deacon@arm.com>
Fri, 26 Aug 2016 10:20:11 +0000 (11:20 +0100)
commitcc65006343b210c93415bcb57300b23d94154730
tree406375ee8cbe3c5b9061a96164f6910847557bec
parentff2b0a1b3bb32c15155f97328b670a3ef80e5818
cpu/hotplug: Allow suspend/resume CPU to be specified

disable_nonboot_cpus() assumes that the lowest numbered online CPU is
the boot CPU, and that this is the correct CPU to run any power
management code on.

On x86 this is always correct, as CPU0 cannot (easily) by taken offline.

On arm64 CPU0 can be taken offline. For hibernate/resume this means we
may hibernate on a CPU other than CPU0. If the system is rebooted with
kexec 'CPU0' will be assigned to a different physical CPU. This
complicates hibernate/resume as now we can't trust the CPU numbers.
Arch code can find the correct physical CPU, and ensure it is online
before resume from hibernate begins, but also needs to influence
disable_nonboot_cpus()s choice of CPU.

Rename disable_nonboot_cpus() as freeze_secondary_cpus() and add an
argument indicating which CPU should be left standing. Follow the logic
in migrate_to_reboot_cpu() to use the lowest numbered online CPU if the
requested CPU is not online.
Add disable_nonboot_cpus() as an inline function that has the existing
behaviour.

Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
include/linux/cpu.h
kernel/cpu.c