diff options
author | Atish Patra <atish.patra@wdc.com> | 2020-11-18 16:38:25 -0800 |
---|---|---|
committer | Palmer Dabbelt <palmerdabbelt@google.com> | 2021-01-14 15:08:54 -0800 |
commit | eb75541f8b4535cf22e22cd2e60734866868e818 (patch) | |
tree | b136b817c0fc7c45055ca67940a2f569035f6ed8 /arch/arm64/mm/numa.c | |
parent | 5a2308da9f60312addfb5f7bdd15d96ba1299480 (diff) | |
download | linux-next-eb75541f8b4535cf22e22cd2e60734866868e818.tar.gz |
arm64, numa: Change the numa init functions name to be generic
This is a preparatory patch for unifying numa implementation between
ARM64 & RISC-V. As the numa implementation will be moved to generic
code, rename the arm64 related functions to a generic one.
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/arm64/mm/numa.c')
-rw-r--r-- | arch/arm64/mm/numa.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index a8303bc6b62a..0dae54ce7d43 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c @@ -13,7 +13,6 @@ #include <linux/module.h> #include <linux/of.h> -#include <asm/acpi.h> #include <asm/sections.h> struct pglist_data *node_data[MAX_NUMNODES] __read_mostly; @@ -445,16 +444,36 @@ static int __init dummy_numa_init(void) return 0; } +#ifdef CONFIG_ACPI_NUMA +static int __init arch_acpi_numa_init(void) +{ + int ret; + + ret = acpi_numa_init(); + if (ret) { + pr_info("Failed to initialise from firmware\n"); + return ret; + } + + return srat_disabled() ? -EINVAL : 0; +} +#else +static int __init arch_acpi_numa_init(void) +{ + return -EOPNOTSUPP; +} +#endif + /** - * arm64_numa_init() - Initialize NUMA + * arch_numa_init() - Initialize NUMA * * Try each configured NUMA initialization method until one succeeds. The * last fallback is dummy single node config encompassing whole memory. */ -void __init arm64_numa_init(void) +void __init arch_numa_init(void) { if (!numa_off) { - if (!acpi_disabled && !numa_init(arm64_acpi_numa_init)) + if (!acpi_disabled && !numa_init(arch_acpi_numa_init)) return; if (acpi_disabled && !numa_init(of_numa_init)) return; |