diff mbox series

[2/2] MIPS: loongson64: set nid for reserved memblock region

Message ID 20240118123929.369939-3-huangpei@loongson.cn (mailing list archive)
State Superseded
Headers show
Series [1/2] MIPS: reserve exception vector space ONLY ONCE | expand

Commit Message

Huang Pei Jan. 18, 2024, 12:39 p.m. UTC
Commit 61167ad5fecd("mm: pass nid to reserve_bootmem_region()) reveals
that reserved memblock regions have no valid node id set, just set it
right since loongson64 firmware makes it clear in memory layout info.

This work around booting failure on 3A1000+ since commit 61167ad5fecd
("mm: pass nid to reserve_bootmem_region()) under
CONFIG_DEFERRED_STRUCT_PAGE_INIT

Signed-off-by: Huang Pei <huangpei@loongson.cn>
---
 arch/mips/loongson64/init.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c
index f25caa6aa9d3..5bfabc67136a 100644
--- a/arch/mips/loongson64/init.c
+++ b/arch/mips/loongson64/init.c
@@ -97,6 +97,8 @@  void __init szmem(unsigned int node)
 				(u32)node_id, mem_type, &mem_start, &mem_size);
 			break;
 		}
+		/* set nid for reserved memory */
+		memblock_set_node(0, node_id << 44, &memblock.reserved, node_id);
 	}
 
 	/* Reserve vgabios if it comes from firmware */