U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Protsenko <semen.protsenko@linaro.org>
To: Tom Rini <trini@konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Sughosh Ganu <sughosh.ganu@linaro.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Marek Vasut <marex@denx.de>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	u-boot@lists.denx.de
Subject: [PATCH v2 0/2] lmb: Fix reserving the same region multiple times
Date: Tue, 10 Dec 2024 20:17:00 -0600	[thread overview]
Message-ID: <20241211021703.2333-1-semen.protsenko@linaro.org> (raw)

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


             reply	other threads:[~2024-12-11  2:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11  2:17 Sam Protsenko [this message]
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

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=20241211021703.2333-1-semen.protsenko@linaro.org \
    --to=semen.protsenko@linaro.org \
    --cc=caleb.connolly@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=marex@denx.de \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.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