aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorDou Liyang <douly.fnst@cn.fujitsu.com>2017-03-03 03:02:23 -0500
committerThomas Gleixner <tglx@linutronix.de>2017-03-11 08:41:18 -0500
commitc962cff17dfa11f4a8227ac16de2b28aea3312e4 (patch)
tree8400e016a0a9eb1583a7986216d4422b0bcb2a92 /drivers/acpi
parent434fd6353b4c83938029ca6ea7dfa4fc82d602bd (diff)
Revert "x86/acpi: Set persistent cpuid <-> nodeid mapping when booting"
Revert: dc6db24d2476 ("x86/acpi: Set persistent cpuid <-> nodeid mapping when booting") The mapping of "cpuid <-> nodeid" is established at boot time via ACPI tables to keep associations of workqueues and other node related items consistent across cpu hotplug. But, ACPI tables are unreliable and failures with that boot time mapping have been reported on machines where the ACPI table and the physical information which is retrieved at actual hotplug is inconsistent. Revert the mapping implementation so it can be replaced with a less error prone approach. Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com> Tested-by: Xiaolong Ye <xiaolong.ye@intel.com> Cc: rjw@rjwysocki.net Cc: linux-acpi@vger.kernel.org Cc: guzheng1@huawei.com Cc: izumi.taku@jp.fujitsu.com Cc: lenb@kernel.org Link: http://lkml.kernel.org/r/1488528147-2279-2-git-send-email-douly.fnst@cn.fujitsu.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_processor.c5
-rw-r--r--drivers/acpi/bus.c1
-rw-r--r--drivers/acpi/processor_core.c73
3 files changed, 0 insertions, 79 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 4467a8089ab8..5d208a99d0c9 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -182,11 +182,6 @@ int __weak arch_register_cpu(int cpu)
182 182
183void __weak arch_unregister_cpu(int cpu) {} 183void __weak arch_unregister_cpu(int cpu) {}
184 184
185int __weak acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
186{
187 return -ENODEV;
188}
189
190static int acpi_processor_hotadd_init(struct acpi_processor *pr) 185static int acpi_processor_hotadd_init(struct acpi_processor *pr)
191{ 186{
192 unsigned long long sta; 187 unsigned long long sta;
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 80cb5eb75b63..34fbe027e73a 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1249,7 +1249,6 @@ static int __init acpi_init(void)
1249 acpi_wakeup_device_init(); 1249 acpi_wakeup_device_init();
1250 acpi_debugger_init(); 1250 acpi_debugger_init();
1251 acpi_setup_sb_notify_handler(); 1251 acpi_setup_sb_notify_handler();
1252 acpi_set_processor_mapping();
1253 return 0; 1252 return 0;
1254} 1253}
1255 1254
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 611a5585a902..a84386204659 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -278,79 +278,6 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id)
278} 278}
279EXPORT_SYMBOL_GPL(acpi_get_cpuid); 279EXPORT_SYMBOL_GPL(acpi_get_cpuid);
280 280
281#ifdef CONFIG_ACPI_HOTPLUG_CPU
282static bool __init
283map_processor(acpi_handle handle, phys_cpuid_t *phys_id, int *cpuid)
284{
285 int type, id;
286 u32 acpi_id;
287 acpi_status status;
288 acpi_object_type acpi_type;
289 unsigned long long tmp;
290 union acpi_object object = { 0 };
291 struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
292
293 status = acpi_get_type(handle, &acpi_type);
294 if (ACPI_FAILURE(status))
295 return false;
296
297 switch (acpi_type) {
298 case ACPI_TYPE_PROCESSOR:
299 status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
300 if (ACPI_FAILURE(status))
301 return false;
302 acpi_id = object.processor.proc_id;
303
304 /* validate the acpi_id */
305 if(acpi_processor_validate_proc_id(acpi_id))
306 return false;
307 break;
308 case ACPI_TYPE_DEVICE:
309 status = acpi_evaluate_integer(handle, "_UID", NULL, &tmp);
310 if (ACPI_FAILURE(status))
311 return false;
312 acpi_id = tmp;
313 break;
314 default:
315 return false;
316 }
317
318 type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
319
320 *phys_id = __acpi_get_phys_id(handle, type, acpi_id, false);
321 id = acpi_map_cpuid(*phys_id, acpi_id);
322
323 if (id < 0)
324 return false;
325 *cpuid = id;
326 return true;
327}
328
329static acpi_status __init
330set_processor_node_mapping(acpi_handle handle, u32 lvl, void *context,
331 void **rv)
332{
333 phys_cpuid_t phys_id;
334 int cpu_id;
335
336 if (!map_processor(handle, &phys_id, &cpu_id))
337 return AE_ERROR;
338
339 acpi_map_cpu2node(handle, cpu_id, phys_id);
340 return AE_OK;
341}
342
343void __init acpi_set_processor_mapping(void)
344{
345 /* Set persistent cpu <-> node mapping for all processors. */
346 acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
347 ACPI_UINT32_MAX, set_processor_node_mapping,
348 NULL, NULL, NULL);
349}
350#else
351void __init acpi_set_processor_mapping(void) {}
352#endif /* CONFIG_ACPI_HOTPLUG_CPU */
353
354#ifdef CONFIG_ACPI_HOTPLUG_IOAPIC 281#ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
355static int get_ioapic_id(struct acpi_subtable_header *entry, u32 gsi_base, 282static int get_ioapic_id(struct acpi_subtable_header *entry, u32 gsi_base,
356 u64 *phys_addr, int *ioapic_id) 283 u64 *phys_addr, int *ioapic_id)