ACPI: processor: Move checks and availability of acpi_processor earlier
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 29 May 2024 13:34:33 +0000 (14:34 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 28 Jun 2024 17:38:28 +0000 (18:38 +0100)
commitcd9239660b8c0357a7338a33d40a429e48273e77
tree0db9e0f44f64ab8a97f6df74775a1a916afd6ee0
parent47ec9b417ed9b6b8ec2a941cd84d9de62adc358a
ACPI: processor: Move checks and availability of acpi_processor earlier

Make the per_cpu(processors, cpu) entries available earlier so that
they are available in arch_register_cpu() as ARM64 will need access
to the acpi_handle to distinguish between acpi_processor_add()
and earlier registration attempts (which will fail as _STA cannot
be checked).

Reorder the remove flow to clear this per_cpu() after
arch_unregister_cpu() has completed, allowing it to be used in
there as well.

Note that on x86 for the CPU hotplug case, the pr->id prior to
acpi_map_cpu() may be invalid. Thus the per_cpu() structures
must be initialized after that call or after checking the ID
is valid (not hotplug path).

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240529133446.28446-7-Jonathan.Cameron@huawei.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/acpi/acpi_processor.c