diff options
author | James Morse <james.morse@arm.com> | 2021-03-29 18:28:35 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-08-29 15:30:05 +0100 |
commit | 5ccf2382b54fc21d195b9d5dc0bf58e776b3fc13 (patch) | |
tree | 9a8aaead7ce863bf928911dad20eba71460eb43e | |
parent | cc0c7b65fb4414ef89b512d5d5680fa06493b425 (diff) |
ACPI: processor: Register all CPUs from acpi_processor_get_info()
To allow ACPI to skip the call to arch_register_cpu() when the _STA
value indicates the CPU can't be brought online right now, move the
arch_register_cpu() call into acpi_processor_get_info().
Systems can still be booted with 'acpi=off', or in the case of arm64,
not include an ACPI description at all. For these, the CPUs are
registered by cpu_dev_register_generic().
This moves the CPU register logic back to a subsys_initcall(),
while the memory nodes will have been registered earlier.
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/acpi/acpi_processor.c | 6 | ||||
-rw-r--r-- | drivers/base/cpu.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index cf1aa9f6efab..6acc37c76451 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -309,6 +309,12 @@ static int acpi_processor_get_info(struct acpi_device *device) cpufreq_add_device("acpi-cpufreq"); } + if (!invalid_logical_cpuid(pr->id) && cpu_present(pr->id)) { + int ret = arch_register_cpu(pr->id); + if (ret) + return ret; + } + /* * Extra Processor objects may be enumerated on MP systems with * less than the max # of CPUs. They should be ignored _iff diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index eb0d28a38b61..84b716821ab8 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -505,7 +505,7 @@ static void __init cpu_dev_register_generic(void) { int i; - if (!IS_ENABLED(CONFIG_GENERIC_CPU_DEVICES)) + if (!IS_ENABLED(CONFIG_GENERIC_CPU_DEVICES) || !acpi_disabled) return; for_each_present_cpu(i) { |