]> git.baikalelectronics.ru Git - kernel.git/commitdiff
MIPS: Fix build error for loongson64 and sgi-ip27
authorFeiyang Chen <chris.chenfeiyang@gmail.com>
Sat, 19 Mar 2022 09:40:02 +0000 (17:40 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Thu, 24 Mar 2022 08:45:15 +0000 (09:45 +0100)
Select HAVE_ARCH_NODEDATA_EXTENSION for loongson64 to fix build error
when CONFIG_NUMA=y:

mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
(.init.text+0x1714): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: (.init.text+0x1730): undefined reference to `node_data'

Also, select HAVE_ARCH_NODEDATA_EXTENSION for sgi-ip27 to fix build error:

mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init':
page_alloc.c:(.init.text+0x1ba8): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bcc): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1be4): undefined reference to `node_data'
mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bf4): undefined reference to `node_data'

Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn>
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/Kconfig
arch/mips/loongson64/numa.c
arch/mips/sgi-ip27/ip27-memory.c

index 0dae5f1e61cc15039c159bcd923d8f7134657a68..de3b32a507d230cad6ae9659d33ce7b61c5d6808 100644 (file)
@@ -513,6 +513,7 @@ config MACH_LOONGSON64
        select USE_OF
        select BUILTIN_DTB
        select PCI_HOST_GENERIC
+       select HAVE_ARCH_NODEDATA_EXTENSION if NUMA
        help
          This enables the support of Loongson-2/3 family of machines.
 
@@ -709,6 +710,7 @@ config SGI_IP27
        select WAR_R10000_LLSC
        select MIPS_L1_CACHE_SHIFT_7
        select NUMA
+       select HAVE_ARCH_NODEDATA_EXTENSION
        help
          This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics
          workstations.  To compile a Linux kernel that runs on these, say Y
@@ -2708,6 +2710,9 @@ config NUMA
 config SYS_SUPPORTS_NUMA
        bool
 
+config HAVE_ARCH_NODEDATA_EXTENSION
+       bool
+
 config RELOCATABLE
        bool "Relocatable kernel"
        depends on SYS_SUPPORTS_RELOCATABLE
index e8e3e48c533301e6da716e423bcf794600f9340f..69a533148efddcadb6829b1323ac3f64fbb3c62c 100644 (file)
@@ -197,3 +197,13 @@ void __init prom_init_numa_memory(void)
        prom_meminit();
 }
 EXPORT_SYMBOL(prom_init_numa_memory);
+
+pg_data_t * __init arch_alloc_nodedata(int nid)
+{
+       return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
+}
+
+void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
+{
+       __node_data[nid] = pgdat;
+}
index adc2faeecf7c01cda151e3100759e78fec2d2cdd..f79c4839371661237141b866d89743a101411c53 100644 (file)
@@ -422,3 +422,13 @@ void __init mem_init(void)
        memblock_free_all();
        setup_zero_pages();     /* This comes from node 0 */
 }
+
+pg_data_t * __init arch_alloc_nodedata(int nid)
+{
+       return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES);
+}
+
+void arch_refresh_nodedata(int nid, pg_data_t *pgdat)
+{
+       __node_data[nid] = (struct node_data *)pgdat;
+}