Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Fix build error for loongson64 and sgi-ip27

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>

authored by

Feiyang Chen and committed by
Thomas Bogendoerfer
f8f9f21c 8931ddd8

+25
+5
arch/mips/Kconfig
··· 513 513 select USE_OF 514 514 select BUILTIN_DTB 515 515 select PCI_HOST_GENERIC 516 + select HAVE_ARCH_NODEDATA_EXTENSION if NUMA 516 517 help 517 518 This enables the support of Loongson-2/3 family of machines. 518 519 ··· 710 709 select WAR_R10000_LLSC 711 710 select MIPS_L1_CACHE_SHIFT_7 712 711 select NUMA 712 + select HAVE_ARCH_NODEDATA_EXTENSION 713 713 help 714 714 This are the SGI Origin 200, Origin 2000 and Onyx 2 Graphics 715 715 workstations. To compile a Linux kernel that runs on these, say Y ··· 2708 2706 disabled. 2709 2707 2710 2708 config SYS_SUPPORTS_NUMA 2709 + bool 2710 + 2711 + config HAVE_ARCH_NODEDATA_EXTENSION 2711 2712 bool 2712 2713 2713 2714 config RELOCATABLE
+10
arch/mips/loongson64/numa.c
··· 197 197 prom_meminit(); 198 198 } 199 199 EXPORT_SYMBOL(prom_init_numa_memory); 200 + 201 + pg_data_t * __init arch_alloc_nodedata(int nid) 202 + { 203 + return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES); 204 + } 205 + 206 + void arch_refresh_nodedata(int nid, pg_data_t *pgdat) 207 + { 208 + __node_data[nid] = pgdat; 209 + }
+10
arch/mips/sgi-ip27/ip27-memory.c
··· 422 422 memblock_free_all(); 423 423 setup_zero_pages(); /* This comes from node 0 */ 424 424 } 425 + 426 + pg_data_t * __init arch_alloc_nodedata(int nid) 427 + { 428 + return memblock_alloc(sizeof(pg_data_t), SMP_CACHE_BYTES); 429 + } 430 + 431 + void arch_refresh_nodedata(int nid, pg_data_t *pgdat) 432 + { 433 + __node_data[nid] = (struct node_data *)pgdat; 434 + }