[PATCH 2/4] lmb: handle scenario of of encompassing overlap

Sughosh Ganu sughosh.ganu at linaro.org
Tue Feb 18 12:57:43 CET 2025


On Tue, 18 Feb 2025 at 17:08, Simon Glass <sjg at chromium.org> wrote:
>
> Hi Sughosh,
>
> On Thu, 13 Feb 2025 at 06:11, Sughosh Ganu <sughosh.ganu at linaro.org> wrote:
> >
> > The lmb_fix_over_lap_regions() function is called if the added region
> > overlaps with an existing region. The function then fixes the overlap
> > and removes the redundant region. However, it makes an assumption that
> > the overlap would not encompass the existing region, and in such a
> > scenario, it prints a message and returns without making the
> > fix. Handle the case of an encompassing overlap also in the function.
> >
> > Signed-off-by: Sughosh Ganu <sughosh.ganu at linaro.org>
> > Reported-by: Quentin Schulz <quentin.schulz at cherry.de>
> > ---
> >
> > Note: To be applied after an A-b/R-b/T-b from the original author
> > of the lmb_fix_over_lap_regions() function on this
> >
> >  lib/lmb.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
>
> Would it be possible to go back through your dozen-or-so lmb patches
> and add some tests?

I am adding tests in the first patch of this series [1], where I am
fixing the lmb_reserve() function. In certain scenarios, it allows to
reserve memory regions on top of existing reservations. Please check
that patch and suggest additional test cases you think that might be
missing. Thanks.

-sughosh

[1] - https://lore.kernel.org/u-boot/20250213131104.186663-1-sughosh.ganu@linaro.org/T/#m64b8622d1de3973955a9b0239de1f1304bc6d831

>
> Regards,
> Simon


More information about the U-Boot mailing list