public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Randolph Sapp <rs@ti.com>
To: Simon Glass <sjg@chromium.org>, <rs@ti.com>
Cc: <robertcnelson@gmail.com>, <ayush@beagleboard.org>,
	<Erik.Welsh@octavosystems.com>, <anshuld@ti.com>, <bb@ti.com>,
	<trini@konsulko.com>, <afd@ti.com>, <xypron.glpk@gmx.de>,
	<ilias.apalodimas@linaro.org>, <u-boot@lists.denx.de>
Subject: Re: [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb reservations
Date: Tue, 21 Apr 2026 17:14:14 -0500	[thread overview]
Message-ID: <DHZ6GETQ2Z6C.2EZP9ISNJR0E7@ti.com> (raw)
In-Reply-To: <CAFLszTggCLQPaJcRoxhjHOuRM10yW3pr8JjRj+LLA-ZupVOSjg@mail.gmail.com>

On Tue Apr 21, 2026 at 3:40 PM CDT, Simon Glass wrote:
> Hi Randolph,
>
> On 2026-04-20T19:25:18, Randolph Sapp <rs@ti.com> wrote:
>> boot_fdt_add_mem_rsv_regions: free old dtb reservations
>>
>> Add a free flag and an initial call to free allocations covered by the
>> global FDT. This assumes that all calls to boot_fdt_add_mem_rsv_regions
>> occur before the transition to the new device tree, thus we can access
>> the currently active device tree through the global data pointer.
>>
>> This allows us to clearly indicate to the user when a device tree
>> reservation fails. How we handle this can still use some improvement.
>> Right now we'll keep the default behavior and try to boot anyway.
>>
>> This functionality was broken in:
>> 5a6aa7d ("boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()")
>>
>> Signed-off-by: Randolph Sapp <rs@ti.com>
>>
>> arch/mips/lib/bootm.c |  2 +-
>>  boot/bootm.c          |  2 +-
>>  boot/bootm_os.c       |  2 +-
>>  boot/image-board.c    |  2 +-
>>  boot/image-fdt.c      | 57 +++++++++++++++++++++++++++++++++++----------------
>>  include/image.h       |  2 +-
>>  lib/lmb.c             |  2 +-
>>  7 files changed, 45 insertions(+), 24 deletions(-)
>
>> diff --git a/boot/image-fdt.c b/boot/image-fdt.c
>> @@ -69,35 +69,51 @@ static const struct legacy_img_hdr *image_get_fdt(ulong fdt_addr)
>> +static void boot_fdt_reserve_region(u64 addr, u64 size, u32 flags, bool free)
>>  {
>> -     long ret;
>> +     int ret;
>
> nit: perhaps keep this one 'long' since lmb_free() returns long ?
>
> Regards,
> Simon

Ugh, yeah though it should only return 0, -EEXIST, or -1 since that's all
lmb_add_region_flags returns. I'm not going to ask why that's the case.

  reply	other threads:[~2026-04-21 22:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 19:25 [PATCHv4 0/6] various memory related fixups rs
2026-04-20 19:25 ` [PATCHv4 1/6] lmb: allocation flags macro documentation rs
2026-04-21 20:38   ` Simon Glass
2026-04-20 19:25 ` [PATCHv4 2/6] boot_fdt_add_mem_rsv_regions: free old dtb reservations rs
2026-04-21 20:40   ` Simon Glass
2026-04-21 22:14     ` Randolph Sapp [this message]
2026-04-21 22:54       ` Simon Glass
2026-04-21 22:55         ` Randolph Sapp
2026-04-20 19:25 ` [PATCHv4 3/6] efi_dt_fixup: use fdtdec_get_bool rs
2026-04-20 19:25 ` [PATCHv4 4/6] efi_selftest_memory: check for duplicates first rs
2026-04-20 19:25 ` [PATCHv4 5/6] efi_mem_sort: use list_for_each_entry_safe instead rs
2026-04-20 19:25 ` [PATCHv4 6/6] memory: reserve from start_addr_sp to initial_relocaddr rs
2026-04-21 20:42   ` Simon Glass

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=DHZ6GETQ2Z6C.2EZP9ISNJR0E7@ti.com \
    --to=rs@ti.com \
    --cc=Erik.Welsh@octavosystems.com \
    --cc=afd@ti.com \
    --cc=anshuld@ti.com \
    --cc=ayush@beagleboard.org \
    --cc=bb@ti.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=robertcnelson@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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