From: Uwe Kleine-König Date: Fri, 12 Jul 2024 08:13:01 +0000 (+0200) Subject: ARM: mvebu: Warn about memory chunks too small for DDR training X-Git-Tag: v6.12-rc1~185^2~1^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=499243b4058073e60cff0d66a023a16ac6bd9d3f;p=thirdparty%2Fkernel%2Flinux.git ARM: mvebu: Warn about memory chunks too small for DDR training For each memory region the first 10K are reserved for DDR training. Emit a warning if the area happens to be smaller than these 10K. This should not happen, but if it does this message simplifies diagnosing the problem. This fixes a W=1 compiler error: arch/arm/mach-mvebu/board-v7.c: In function ‘mvebu_scan_mem’: arch/arm/mach-mvebu/board-v7.c:84:27: error: variable ‘size’ set but not used [-Werror=unused-but-set-variable] 84 | u64 base, size; | ^~~~ Signed-off-by: Uwe Kleine-König Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT --- diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index fd5d0c8ff6958..04ad651d13a01 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -86,6 +86,9 @@ static int __init mvebu_scan_mem(unsigned long node, const char *uname, base = dt_mem_next_cell(dt_root_addr_cells, ®); size = dt_mem_next_cell(dt_root_size_cells, ®); + if (size < MVEBU_DDR_TRAINING_AREA_SZ) + pr_warn("Too little memory to reserve for DDR training\n"); + memblock_reserve(base, MVEBU_DDR_TRAINING_AREA_SZ); }