linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training
@ 2024-07-12  8:13 Uwe Kleine-König
  2024-07-13 17:35 ` Andrew Lunn
  2024-09-02 12:35 ` Gregory CLEMENT
  0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2024-07-12  8:13 UTC (permalink / raw)
  To: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
	Thomas Petazzoni
  Cc: linux-arm-kernel

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 <u.kleine-koenig@baylibre.com>
---
Hello,

the (implicit) first iteration of this patch is available at
https://lore.kernel.org/linux-arm-kernel/20240708093145.1398949-2-u.kleine-koenig@baylibre.com/

In this v2 the size variable is evaluated to emit a warning instead of
being dropped, which was done in v1.

Best regards
Uwe

 arch/arm/mach-mvebu/board-v7.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index fd5d0c8ff695..04ad651d13a0 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, &reg);
 		size = dt_mem_next_cell(dt_root_size_cells, &reg);
 
+		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);
 	}
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training
  2024-07-12  8:13 [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training Uwe Kleine-König
@ 2024-07-13 17:35 ` Andrew Lunn
  2024-09-02 12:35 ` Gregory CLEMENT
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2024-07-13 17:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Gregory Clement, Sebastian Hesselbarth, Thomas Petazzoni,
	linux-arm-kernel

On Fri, Jul 12, 2024 at 10:13:01AM +0200, Uwe Kleine-König wrote:
> 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 <u.kleine-koenig@baylibre.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training
  2024-07-12  8:13 [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training Uwe Kleine-König
  2024-07-13 17:35 ` Andrew Lunn
@ 2024-09-02 12:35 ` Gregory CLEMENT
  1 sibling, 0 replies; 3+ messages in thread
From: Gregory CLEMENT @ 2024-09-02 12:35 UTC (permalink / raw)
  To: Uwe Kleine-König, Andrew Lunn, Sebastian Hesselbarth,
	Thomas Petazzoni
  Cc: linux-arm-kernel

Hi Uwe,

> 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 <u.kleine-koenig@baylibre.com>

Applied on mvebu/arm

Thanks,

Gregory
> ---
> Hello,
>
> the (implicit) first iteration of this patch is available at
> https://lore.kernel.org/linux-arm-kernel/20240708093145.1398949-2-u.kleine-koenig@baylibre.com/
>
> In this v2 the size variable is evaluated to emit a warning instead of
> being dropped, which was done in v1.
>
> Best regards
> Uwe
>
>  arch/arm/mach-mvebu/board-v7.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
> index fd5d0c8ff695..04ad651d13a0 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, &reg);
>  		size = dt_mem_next_cell(dt_root_size_cells, &reg);
>  
> +		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);
>  	}
>  
> -- 
> 2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-02 12:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-12  8:13 [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training Uwe Kleine-König
2024-07-13 17:35 ` Andrew Lunn
2024-09-02 12:35 ` Gregory CLEMENT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).