From: Dong Aisheng Date: Fri, 11 Jun 2021 13:11:53 +0000 (+0800) Subject: of: of_reserved_mem: mark nomap memory instead of removing X-Git-Tag: v5.15~817^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b25995f5319adc354a430df0eb2ec7f79a1e807;p=platform%2Fkernel%2Flinux-starfive.git of: of_reserved_mem: mark nomap memory instead of removing Since commit 86588296acbf ("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 Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng Reviewed-by: Quentin Perret Link: https://lore.kernel.org/r/20210611131153.3731147-2-aisheng.dong@nxp.com Signed-off-by: Rob Herring --- diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index b1d7fc3..fd3964d 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -42,7 +42,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, *res_base = base; if (nomap) - return memblock_remove(base, size); + return memblock_mark_nomap(base, size); return memblock_reserve(base, size); } @@ -276,7 +276,7 @@ void __init fdt_init_reserved_mem(void) pr_info("node %s compatible matching fail\n", rmem->name); if (nomap) - memblock_add(rmem->base, rmem->size); + memblock_clear_nomap(rmem->base, rmem->size); else memblock_free(rmem->base, rmem->size); }