x86-64, NUMA: Wrap acpi_numa_init() so that failure can be indicated by return value
authorTejun Heo <tj@kernel.org>
Wed, 16 Feb 2011 11:13:06 +0000 (12:13 +0100)
committerTejun Heo <tj@kernel.org>
Wed, 16 Feb 2011 11:13:06 +0000 (12:13 +0100)
Because of the way ACPI tables are parsed, the generic
acpi_numa_init() couldn't return failure when error was detected by
arch hooks.  Instead, the failure state was recorded and later arch
dependent init hook - acpi_scan_nodes() - would fail.

Wrap acpi_numa_init() with x86_acpi_numa_init() so that failure can be
indicated as return value immediately.  This is in preparation for
further NUMA init cleanups.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Shaohui Zheng <shaohui.zheng@intel.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/acpi.h
arch/x86/kernel/setup.c
arch/x86/mm/srat_64.c

index 4e5dff9e0b3944d0e572f95aa988d6658ea6ae4e..06fb7865eff2a630d87e6dc1d4bef996e8b30d69 100644 (file)
@@ -187,6 +187,7 @@ struct bootnode;
 extern int acpi_numa;
 extern void acpi_get_nodes(struct bootnode *physnodes, unsigned long start,
                                unsigned long end);
+extern int x86_acpi_numa_init(void);
 extern int acpi_scan_nodes(void);
 #define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
 
index 96810a3c6003bd1fe03aade9dcea2a077816afb6..c9a139c3056be80f25abcae4e45bfc70d16a9a97 100644 (file)
@@ -995,7 +995,7 @@ void __init setup_arch(char **cmdline_p)
        /*
         * Parse SRAT to discover nodes.
         */
-       acpi = !acpi_numa_init();
+       acpi = !x86_acpi_numa_init();
 #endif
 
 #ifdef CONFIG_AMD_NUMA
index 4f9dbf066ca4454602761f7a59acb33230dfa205..56b92635d87c6a305b400c758034a99dc12afca9 100644 (file)
@@ -358,6 +358,16 @@ void __init acpi_get_nodes(struct bootnode *physnodes, unsigned long start,
 }
 #endif /* CONFIG_NUMA_EMU */
 
+int __init x86_acpi_numa_init(void)
+{
+       int ret;
+
+       ret = acpi_numa_init();
+       if (ret < 0)
+               return ret;
+       return srat_disabled() ? -EINVAL : 0;
+}
+
 /* Use the information discovered above to actually set up the nodes. */
 int __init acpi_scan_nodes(void)
 {