aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/numa.c')
-rw-r--r--drivers/acpi/numa.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 5718566e00f9..3b5c3189fd99 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -274,15 +274,21 @@ acpi_table_parse_srat(enum acpi_srat_type id,
274 274
275int __init acpi_numa_init(void) 275int __init acpi_numa_init(void)
276{ 276{
277 int ret = 0; 277 int cnt = 0;
278
279 /*
280 * Should not limit number with cpu num that is from NR_CPUS or nr_cpus=
281 * SRAT cpu entries could have different order with that in MADT.
282 * So go over all cpu entries in SRAT to get apicid to node mapping.
283 */
278 284
279 /* SRAT: Static Resource Affinity Table */ 285 /* SRAT: Static Resource Affinity Table */
280 if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { 286 if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
281 acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY, 287 acpi_table_parse_srat(ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY,
282 acpi_parse_x2apic_affinity, nr_cpu_ids); 288 acpi_parse_x2apic_affinity, 0);
283 acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, 289 acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
284 acpi_parse_processor_affinity, nr_cpu_ids); 290 acpi_parse_processor_affinity, 0);
285 ret = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, 291 cnt = acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
286 acpi_parse_memory_affinity, 292 acpi_parse_memory_affinity,
287 NR_NODE_MEMBLKS); 293 NR_NODE_MEMBLKS);
288 } 294 }
@@ -291,7 +297,10 @@ int __init acpi_numa_init(void)
291 acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); 297 acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit);
292 298
293 acpi_numa_arch_fixup(); 299 acpi_numa_arch_fixup();
294 return ret; 300
301 if (cnt <= 0)
302 return cnt ?: -ENOENT;
303 return 0;
295} 304}
296 305
297int acpi_get_pxm(acpi_handle h) 306int acpi_get_pxm(acpi_handle h)