From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
"Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] ARM: mvebu: Warn about memory chunks too small for DDR training
Date: Mon, 02 Sep 2024 14:35:35 +0200 [thread overview]
Message-ID: <87seuifd2g.fsf@BLaptop.bootlin.com> (raw)
In-Reply-To: <20240712081302.901842-2-u.kleine-koenig@baylibre.com>
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, ®);
> 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);
> }
>
> --
> 2.43.0
prev parent reply other threads:[~2024-09-02 12:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87seuifd2g.fsf@BLaptop.bootlin.com \
--to=gregory.clement@bootlin.com \
--cc=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).