[PATCH] lmb: notify when adjacent regions are added

Simon Glass sjg at chromium.org
Fri Oct 18 17:02:58 CEST 2024


Hi Caleb,

On Fri, 18 Oct 2024 at 08:08, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> Thanks Caleb,
>
> On Fri, 18 Oct 2024 at 16:53, Caleb Connolly <caleb.connolly at linaro.org> wrote:
> >
> > lmb_add_region() returns a positive integer if the added regions causes
> > existing regions to be coalesced. We still want to notify the EFI
> > subsystem about these added regions though, so adjust lmb_add() to only
> > bail on errors.
> >
> > This fixes EFI memory allocation on boards with adjacent memory banks as is the
> > case on several Qualcomm boards like the RB3 Gen 2.
> >
> > Fixes: 2f6191526a13 (lmb: notify of any changes to the LMB memory map)
> > Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
> > ---
> > Cc: u-boot-qcom at groups.io
> > ---
> >  lib/lmb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/lmb.c b/lib/lmb.c
> > index 78fe2d4de7c6..7e90f178763b 100644
> > --- a/lib/lmb.c
> > +++ b/lib/lmb.c
> > @@ -486,9 +486,9 @@ long lmb_add(phys_addr_t base, phys_size_t size)
> >         long ret;
> >         struct alist *lmb_rgn_lst = &lmb.free_mem;
> >
> >         ret = lmb_add_region(lmb_rgn_lst, base, size);
> > -       if (ret)
> > +       if (ret < 0)
> >                 return ret;
> >
> >         if (lmb_should_notify(LMB_NONE))
> >                 return lmb_map_update_notify(base, size, MAP_OP_ADD);
> > --
> > 2.46.2
> >
>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>

Is it possible to add a test for this case? It is a good idea to plug
a testing gap when fixing a bug.

Regards,
Simon


More information about the U-Boot mailing list