[PATCH v2 0/2] lmb: Fix reserving the same region multiple times
Michal Simek
monstr at monstr.eu
Thu Dec 12 15:40:49 CET 2024
st 11. 12. 2024 v 3:17 odesílatel Sam Protsenko
<semen.protsenko at linaro.org> napsal:
>
> This series is intended to be picked up for the v2025.01 release.
>
> Since commit 1d9aa4a283da ("lmb: Fix the allocation of overlapping
> memory areas with !LMB_NONE") the lmb_add_region_flags() returns -1 when
> the caller tries to add the already existing region with !LMB_NONE
> flags (it was returning 0 before that patch). That causes
> boot_fdt_reserve_region() function to print erroneous error messages
> when it's called consequently more than one time.
>
> Make lmb_add_region_flags() return -EEXIST when the already added region
> with !LMB_NONE flags is being added, and then check that error code in
> boot_fdt_reserve_region() to avoid printing the misleading error
> messages.
>
> This series fixes all 3 found cases (discussed at [1]) for the false
> positive error messages. All unit tests pass in sandbox U-Boot.
>
> Changes in v2:
> - Split the original series by two separate series (cleanups will be
> sent out as a different one)
> - Collected all R-b and A-b tags from review
> - Patch #1: Removed the check for exactly the same region, and return
> -EEXIST in the branch handling overlapping regions instead
> - Reworded the commit messages slightly
>
> [1] https://lists.denx.de/pipermail/u-boot/2024-December/574123.html
>
> Sam Protsenko (2):
> lmb: Return -EEXIST in lmb_add_region_flags() if region already added
> boot: fdt: Handle already reserved memory in boot_fdt_reserve_region()
>
> boot/image-fdt.c | 2 +-
> lib/lmb.c | 26 +++++++++++++-------------
> test/lib/lmb.c | 2 +-
> 3 files changed, 15 insertions(+), 15 deletions(-)
>
> --
> 2.39.5
>
Tested-by: Michal Simek <michal.simek at amd.com>
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
More information about the U-Boot
mailing list