aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_processor.c
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@huawei.com>2013-09-01 23:57:34 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-23 19:39:39 -0400
commitca9f62ac783bf88c54143f8065adc0fc8df859c1 (patch)
treec22585a41438abe61565def29b3a055cb6ebad70 /drivers/acpi/acpi_processor.c
parent4a10c2ac2f368583138b774ca41fac4207911983 (diff)
ACPI / processor: Introduce apic_id in struct processor to save parsed APIC id
For cpu hot add, we evaluate _MAT or parse MADT twice to get APIC id, here is the code logic: acpi_processor_add() acpi_processor_get_info() acpi_get_cpuid() will evaluate _MAT or parse MADT; acpi_processor_hotadd_init() acpi_map_lsapic() will evaluate _MAT again; This can be done more effectively, this patch introduces apic_id in struct processor to save parsed APIC id, and then we can use it and remove the duplicated _MAT evaluation. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r--drivers/acpi/acpi_processor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index f29e06efa479..f89f914cb97e 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -270,7 +270,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
270 device_declaration = 1; 270 device_declaration = 1;
271 pr->acpi_id = value; 271 pr->acpi_id = value;
272 } 272 }
273 cpu_index = acpi_get_cpuid(pr->handle, device_declaration, pr->acpi_id); 273 pr->apic_id = acpi_get_apicid(pr->handle, device_declaration,
274 pr->acpi_id);
275 cpu_index = acpi_map_cpuid(pr->apic_id, pr->acpi_id);
274 276
275 /* Handle UP system running SMP kernel, with no LAPIC in MADT */ 277 /* Handle UP system running SMP kernel, with no LAPIC in MADT */
276 if (!cpu0_initialized && (cpu_index == -1) && 278 if (!cpu0_initialized && (cpu_index == -1) &&