summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2021-03-29 18:28:35 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-09-11 10:05:04 +0100
commit9d0b33273119d6c0d9112a28c2cc2eb8c671fbeb (patch)
tree38ff7a02b7a3935bd7e1eba654f81e038ac85c5b
parent01b5a8ed8e7600113fc5bf11c9f62f490d052f0c (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.c6
-rw-r--r--drivers/base/cpu.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index c3ce48ef6488..65ac396db8dd 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -313,6 +313,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 579064fda97b..4d218db63a05 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -537,7 +537,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) {