U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] lmb: Fix reserving the same region multiple times
@ 2024-12-11  2:17 Sam Protsenko
  2024-12-11  2:17 ` [PATCH v2 1/2] lmb: Return -EEXIST in lmb_add_region_flags() if region already added Sam Protsenko
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sam Protsenko @ 2024-12-11  2:17 UTC (permalink / raw)
  To: Tom Rini
  Cc: Ilias Apalodimas, Sughosh Ganu, Heinrich Schuchardt, Simon Glass,
	Caleb Connolly, Marek Vasut, Laurent Pinchart, Patrick Delaunay,
	u-boot

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-12-12 19:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11  2:17 [PATCH v2 0/2] lmb: Fix reserving the same region multiple times Sam Protsenko
2024-12-11  2:17 ` [PATCH v2 1/2] lmb: Return -EEXIST in lmb_add_region_flags() if region already added Sam Protsenko
2024-12-11  6:15   ` Ilias Apalodimas
2024-12-11  2:17 ` [PATCH v2 2/2] boot: fdt: Handle already reserved memory in boot_fdt_reserve_region() Sam Protsenko
2024-12-12 14:40 ` [PATCH v2 0/2] lmb: Fix reserving the same region multiple times Michal Simek
2024-12-12 19:18 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox