Commit 7b25995f authored by Dong Aisheng's avatar Dong Aisheng Committed by Rob Herring

of: of_reserved_mem: mark nomap memory instead of removing

Since commit 86588296 ("fdt: Properly handle "no-map" field in the memory region"),
nomap memory is changed to call memblock_mark_nomap() instead of
memblock_remove(). But it only changed the reserved memory with fixed
addr and size case in early_init_dt_reserve_memory_arch(), not
including the dynamical allocation by size case in
early_init_dt_alloc_reserved_memory_arch().

Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: default avatarQuentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20210611131153.3731147-2-aisheng.dong@nxp.comSigned-off-by: default avatarRob Herring <robh@kernel.org>
parent 3c6867a1
...@@ -42,7 +42,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, ...@@ -42,7 +42,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
*res_base = base; *res_base = base;
if (nomap) if (nomap)
return memblock_remove(base, size); return memblock_mark_nomap(base, size);
return memblock_reserve(base, size); return memblock_reserve(base, size);
} }
...@@ -276,7 +276,7 @@ void __init fdt_init_reserved_mem(void) ...@@ -276,7 +276,7 @@ void __init fdt_init_reserved_mem(void)
pr_info("node %s compatible matching fail\n", pr_info("node %s compatible matching fail\n",
rmem->name); rmem->name);
if (nomap) if (nomap)
memblock_add(rmem->base, rmem->size); memblock_clear_nomap(rmem->base, rmem->size);
else else
memblock_free(rmem->base, rmem->size); memblock_free(rmem->base, rmem->size);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment