When cpu was hot-added or hot removed, the cpu_present_map and APIC id map to logic cpu id should be updated. acpi_map/unmap_lsapic() will do this.
available_cpus will be used for ACPI driver, so remove __initdata attribute for it, and change it into global for future use too.
Signed-off-by: Hanjun Guo hanjun.guo@linaro.org --- drivers/acpi/plat/arm/boot.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/plat/arm/boot.c b/drivers/acpi/plat/arm/boot.c index aaacfbb..82b7bd6 100644 --- a/drivers/acpi/plat/arm/boot.c +++ b/drivers/acpi/plat/arm/boot.c @@ -52,7 +52,7 @@ int acpi_disabled; EXPORT_SYMBOL(acpi_disabled);
/* available_cpus here means enabled cpu in MADT */ -static int available_cpus __initdata; +int available_cpus;
/* Map logic cpu id to physical APIC id. * APIC = GIC cpu interface on ARM @@ -463,10 +463,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) goto free_tmp_map;
cpumask_copy(tmp_map, cpu_present_mask); -#ifdef CONFIG_X86 - /* BOZO: ?? */ acpi_register_lapic(physid, ACPI_MADT_ENABLED); -#endif
/* * If acpi_register_lapic successfully generates a new logical cpu @@ -474,7 +471,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) */ cpumask_andnot(new_map, cpu_present_mask, tmp_map); if (cpumask_empty(new_map)) { - printk("Unable to map lapic to logical cpu number\n"); + pr_err("Unable to map lapic to logical cpu number\n"); retval = -EINVAL; goto free_new_map; } @@ -504,12 +501,9 @@ EXPORT_SYMBOL(acpi_map_lsapic);
int acpi_unmap_lsapic(int cpu) { -#ifdef CONFIG_X86 - /* BOZO: ??? */ - per_cpu(x86_cpu_to_apicid, cpu) = -1; + arm_cpu_to_apicid[cpu] = -1; set_cpu_present(cpu, false); - num_processors--; -#endif + available_cpus--;
return 0; }