U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Emanuele Ghidoli <ghidoliemanuele@gmail.com>
To: Joseph Guo <qijian.guo@nxp.com>, Simon Glass <sjg@chromium.org>,
	Randolph Sapp <rs@ti.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>, Anshul Dalal <anshuld@ti.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	"Joseph Guo (OSS)" <qijian.guo@oss.nxp.com>
Subject: Re: [PATCH] boot: image-fdt: downgrade -EINVAL reservation failure to debug
Date: Thu, 16 Jul 2026 10:25:13 +0200	[thread overview]
Message-ID: <e1a26574-4f7d-46f0-b757-55f419df326b@gmail.com> (raw)
In-Reply-To: <20260713-downgrade-v1-1-183a2300741b@nxp.com>



On 7/13/26 10:45, Joseph Guo wrote:
> When boot_fdt_handle_region() attempts to reserve a DTS reserved-memory
> region via lmb_alloc_mem(), it may receive -EINVAL if the region's
> physical address falls outside the LMB-managed memory range (i.e.
> below PHYS_SDRAM on platforms where U-Boot does not manage the lower
> DRAM window).
> 
> A typical example is platforms like i.MX95 where PHYS_SDRAM starts at
> 0x90000000, but remoteproc/rpmsg carveouts (vdev vrings, vdev buffer,
> resource table) are placed at 0x88xxxxxx by hardware convention. Those
> addresses are unreachable by U-Boot's allocator anyway, so failing to
> mark them reserved has no practical consequence -- U-Boot will never
> accidentally place the initrd or FDT blob there.
> 
> Printing ERROR for a condition that is harmless and expected on many
> platforms is misleading. Downgrade the -EINVAL case to debug() to
> suppress the spurious output while preserving full visibility under
> DEBUG/log builds.
> 
> Real failures (e.g. -EEXIST from an overlapping reservation) continue
> to be reported as ERROR.
> 
> Fixes: 623f6c5b6ab7 ("boot: image-fdt: free old dtb reservations")
> Signed-off-by: Joseph Guo <qijian.guo@nxp.com>
> ---
>  boot/image-fdt.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/boot/image-fdt.c b/boot/image-fdt.c
> index 9e0e0f93edd34ae9056926883b1a802858e179d9..2175fa338f55110862100fa9f491a0957e85ce56 100644
> --- a/boot/image-fdt.c
> +++ b/boot/image-fdt.c
> @@ -95,6 +95,9 @@ static void boot_fdt_handle_region(u64 addr, u64 size, u32 flags, bool free)
>  		debug("   %s fdt memory region: addr=%llx size=%llx flags=%x\n",
>  		      free ? "freed" : "reserved", (unsigned long long)addr,
>  		      (unsigned long long)size, flags);
> +	} else if (ret == -EINVAL) {
> +		debug("   skipping fdt memory region outside LMB range (addr=%llx size=%llx flags=%x)\n",
> +		      (unsigned long long)addr, (unsigned long long)size, flags);
>  	} else {
>  		printf("ERROR: %s fdt memory region failed (addr=%llx size=%llx flags=%x): %ld\n",
>  		       free ? "freeing" : "reserving", (unsigned long long)addr,
> 
> ---
> base-commit: 6741b0dfb41dc82a284ab1cff4c58af6ef2f3f9c
> change-id: 20260713-downgrade-f8319ab2d75b
> 
> Best regards,

Hi Joseph,

Tested on Toradex Aquila iMX95, which has reserved-memory regions for
the Cortex-M7 (vrings, vdev buffer, resource table) below PHYS_SDRAM.
The spurious ERROR messages are gone and boot is unaffected.

Kind regards,
Emanuele

Tested-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>

  reply	other threads:[~2026-07-16  8:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  8:45 [PATCH] boot: image-fdt: downgrade -EINVAL reservation failure to debug Joseph Guo
2026-07-16  8:25 ` Emanuele Ghidoli [this message]
2026-07-16 11:55   ` Jonas Karlman
2026-07-17  5:18     ` Joseph Guo (OSS)
2026-07-17 12:00       ` Emanuele Ghidoli

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=e1a26574-4f7d-46f0-b757-55f419df326b@gmail.com \
    --to=ghidoliemanuele@gmail.com \
    --cc=anshuld@ti.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=qijian.guo@nxp.com \
    --cc=qijian.guo@oss.nxp.com \
    --cc=rs@ti.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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