Skip to content

Commit

Permalink
MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA
Browse files Browse the repository at this point in the history
Use memblock_add_node to add new memblock region within a NUMA node
in early_parse_mem() under CONFIG_NUMA, otherwise the mem parameter
can not work well.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Tiezhu Yang authored and Thomas Bogendoerfer committed May 24, 2022
1 parent fb3d696 commit 795d82e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <asm/cdmm.h>
#include <asm/cpu.h>
#include <asm/debug.h>
#include <asm/mmzone.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/smp-ops.h>
Expand Down Expand Up @@ -364,7 +365,10 @@ static int __init early_parse_mem(char *p)
if (*p == '@')
start = memparse(p + 1, &p);

memblock_add(start, size);
if (IS_ENABLED(CONFIG_NUMA))
memblock_add_node(start, size, pa_to_nid(start), MEMBLOCK_NONE);
else
memblock_add(start, size);

return 0;
}
Expand Down

0 comments on commit 795d82e

Please sign in to comment.