Skip to content
Permalink
Browse files
MIPS: Fix cmdline "mem=" parameter parsing
This problem may only occur on NUMA platforms. When machine start with the
"mem=" parameter on Loongson64, it cannot boot. When parsing the "mem="
parameter, first remove all RAM, and then add memory through memblock_add(),
which causes the newly added memory to be located on MAX_NUMNODES.

The solution is to add the current "mem=" parameter range to the memory area
of the corresponding node, instead of adding all of it to the MAX_NUMNODES
node area. Get the node number corresponding to the "mem=" parameter range
through pa_to_nid(), and then add it to the corresponding node through
memblock_add_node().

Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
  • Loading branch information
Youling Tang authored and intel-lab-lkp committed Apr 19, 2021
1 parent bf05bf1 commit c9cec6a7cf36ea04b1d8aca273a27e92007085e2
Showing 1 changed file with 1 addition and 1 deletion.
@@ -359,7 +359,7 @@ static int __init early_parse_mem(char *p)
if (*p == '@')
start = memparse(p + 1, &p);

memblock_add(start, size);
memblock_add_node(start, size, pa_to_nid(start));

return 0;
}

0 comments on commit c9cec6a

Please sign in to comment.