diff mbox series

[2/2] MIPS: sgi-ip27: Fix build error

Message ID 70de3680b4c9d0eabaca03dc0140a1ca3a246a5e.1647671808.git.chenfeiyang@loongson.cn (mailing list archive)
State Superseded
Headers show
Series MIPS: Fix build error for loongson64 and sgi-ip27 | expand

Commit Message

Feiyang Chen March 19, 2022, 7:11 a.m. UTC
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>
---
 arch/mips/Kconfig                |  4 ++++
 arch/mips/sgi-ip27/ip27-memory.c | 10 ++++++++++
 2 files changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 0dae5f1e61cc..beaa2aa08c59 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -709,6 +709,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 +2709,9 @@  config NUMA
 config SYS_SUPPORTS_NUMA
 	bool
 
+config HAVE_ARCH_NODEDATA_EXTENSION
+	bool
+
 config RELOCATABLE
 	bool "Relocatable kernel"
 	depends on SYS_SUPPORTS_RELOCATABLE
diff --git a/arch/mips/sgi-ip27/ip27-memory.c b/arch/mips/sgi-ip27/ip27-memory.c
index adc2faeecf7c..f79c48393716 100644
--- a/arch/mips/sgi-ip27/ip27-memory.c
+++ b/arch/mips/sgi-ip27/ip27-memory.c
@@ -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;
+}