Message ID | 20240127091221.2884-2-huangpei@loongson.cn (mailing list archive) |
---|---|
State | Accepted |
Commit | 822df315cc7c85c3c10afcc6408b254a6fa0f166 |
Headers | show |
Series | MIPS: loongson64: set nid for reserved memblock region | expand |
On Sat, Jan 27, 2024 at 05:12:21PM +0800, Huang Pei wrote: > 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 works 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 | 3 +++ > arch/mips/loongson64/numa.c | 2 ++ > 2 files changed, 5 insertions(+) I would've needed a patch just fixing the one line since the broken commit is already in mips-fixes, which is a public tree so no rebasing. I'm going to revert the old commit instead and add the new one, BTW. please send new patches as it's own thread and not as a reply. Thomas.
On Sat, Jan 27, 2024 at 11:04:04AM +0100, Thomas Bogendoerfer wrote: > On Sat, Jan 27, 2024 at 05:12:21PM +0800, Huang Pei wrote: > > 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 works 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 | 3 +++ > > arch/mips/loongson64/numa.c | 2 ++ > > 2 files changed, 5 insertions(+) > > I would've needed a patch just fixing the one line since the broken commit > is already in mips-fixes, which is a public tree so no rebasing. > I'm going to revert the old commit instead and add the new one, > BTW. please send new patches as it's own thread and not as a reply. > Ok, new patches always as its own thread not as a reply, I got it. > Thomas. > > -- > Crap can work. Given enough thrust pigs will fly, but it's not necessarily a > good idea. [ RFC1925, 2.3 ]
diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c index f25caa6aa9d3..553142c1f14f 100644 --- a/arch/mips/loongson64/init.c +++ b/arch/mips/loongson64/init.c @@ -103,6 +103,9 @@ void __init szmem(unsigned int node) if (loongson_sysconf.vgabios_addr) memblock_reserve(virt_to_phys((void *)loongson_sysconf.vgabios_addr), SZ_256K); + /* set nid for reserved memory */ + memblock_set_node((u64)node << 44, (u64)(node + 1) << 44, + &memblock.reserved, node); } #ifndef CONFIG_NUMA diff --git a/arch/mips/loongson64/numa.c b/arch/mips/loongson64/numa.c index 8f61e93c0c5b..68dafd6d3e25 100644 --- a/arch/mips/loongson64/numa.c +++ b/arch/mips/loongson64/numa.c @@ -132,6 +132,8 @@ static void __init node_mem_init(unsigned int node) /* Reserve pfn range 0~node[0]->node_start_pfn */ memblock_reserve(0, PAGE_SIZE * start_pfn); + /* set nid for reserved memory on node 0 */ + memblock_set_node(0, 1ULL << 44, &memblock.reserved, 0); } }
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 works 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 | 3 +++ arch/mips/loongson64/numa.c | 2 ++ 2 files changed, 5 insertions(+)