From: Daniel Golle <daniel@makrotopia.org>
To: "Alexey Brodkin" <alexey.brodkin@synopsys.com>,
"Eugeniy Paltsev" <Eugeniy.Paltsev@synopsys.com>,
"Tom Rini" <trini@konsulko.com>,
"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
"Michal Simek" <michal.simek@amd.com>,
"Daniel Schwierzeck" <daniel.schwierzeck@gmail.com>,
"Tim Ouyang" <tim609@andestech.com>,
"Leo Liang" <leo.liang@sifive.com>, "Yao Zi" <me@ziyao.cc>,
"Simon Glass" <sjg@chromium.org>, "Bin Meng" <bmeng.cn@gmail.com>,
"Daniel Golle" <daniel@makrotopia.org>,
"Aristo Chen" <aristo.chen@canonical.com>,
"João Loureiro" <joaofl@gmail.com>,
uboot-snps-arc@synopsys.com, u-boot@lists.u-boot-project.org,
openwrt-devel@lists.openwrt.org
Subject: [PATCH 0/9] imagemap: Fix boot errors and resource lifetimes
Date: Sat, 14 Nov 2026 00:08:55 +0000 [thread overview]
Message-ID: <cover.1794614777.git.daniel@makrotopia.org> (raw)
This series fixes bootm error handling and resource lifetime issues
found while testing the imagemap boot path. It applies on top of main.
Ordinary allocation failures and unsupported bootm subcommands return
-1, which is also BOOTM_ERR_RESET. Return -ENOMEM and -ENOSYS for these
failures so they return to the shell. Sandbox gains the same subcommand
behaviour, with tests for unsupported subcommands and failed ramdisk
allocation.
A failed imagemap extension can leave the original mapping pointing at
unreserved memory, which cleanup may free after another user has
allocated it. Keep the original mapping and reservation until the larger
region has been read successfully. When the region moves, copy its
cached data and read only the added range. Document region replacement
and pointer lifetime, and add regression coverage for failed extensions
and relocation.
Removing and re-probing a SPI flash leaves its old mtd_blk device bound,
so each probe adds another block device. Unbind it and free its pointer
storage when deleting the MTD master, with a test for the block count
after re-probing.
Built for sandbox and qemu_arm64. The sandbox bootm and imagemap suites
pass all nine and 16 tests respectively. On QEMU, checked that
unsupported bdt and cmdline subcommands and a ramdisk allocation failure
return to the shell.
Daniel Golle (9):
boot: Return distinct errors for ordinary bootm failures
sandbox: bootm: Reject unsupported subcommands
test: boot: bootm: Check ordinary failures
boot: imagemap: Preserve mappings when an extend fails
test: boot: imagemap: Check a failed extend
boot: imagemap: Clarify region replacement
mtd: Unbind the block device when removing a master
test: dm: sf: Check the block count after re-probing
boot: imagemap: Copy cached data when moving a region
arch/arc/lib/bootm.c | 5 +-
arch/arm/lib/bootm.c | 3 +-
arch/microblaze/lib/bootm.c | 3 +-
arch/mips/lib/bootm.c | 3 +-
arch/riscv/lib/bootm.c | 3 +-
arch/sandbox/lib/bootm.c | 5 ++
arch/x86/lib/bootm.c | 2 +-
boot/image-board.c | 13 ++--
boot/imagemap.c | 151 ++++++++++++++++++++++--------------
drivers/mtd/mtdcore.c | 48 +++++++++++-
include/imagemap.h | 13 +++-
test/boot/bootm.c | 53 +++++++++++++
test/boot/imagemap.c | 85 ++++++++++++++++++++
test/dm/sf.c | 32 ++++++++
14 files changed, 340 insertions(+), 79 deletions(-)
base-commit: 6487c50b8a40f2668ab98a892b9300ad5c181f38
--
2.56.0
next reply other threads:[~2026-11-14 0:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 0:08 Daniel Golle [this message]
2026-11-14 0:09 ` [PATCH 1/9] boot: Return distinct errors for ordinary bootm failures Daniel Golle
2026-11-14 0:09 ` [PATCH 2/9] sandbox: bootm: Reject unsupported subcommands Daniel Golle
2026-11-14 0:10 ` [PATCH 3/9] test: boot: bootm: Check ordinary failures Daniel Golle
2026-11-14 0:11 ` [PATCH 4/9] boot: imagemap: Preserve mappings when an extend fails Daniel Golle
2026-11-14 0:11 ` [PATCH 5/9] test: boot: imagemap: Check a failed extend Daniel Golle
2026-11-14 0:11 ` [PATCH 6/9] boot: imagemap: Clarify region replacement Daniel Golle
2026-11-14 0:11 ` [PATCH 7/9] mtd: Unbind the block device when removing a master Daniel Golle
2026-11-14 0:12 ` [PATCH 8/9] test: dm: sf: Check the block count after re-probing Daniel Golle
2026-11-14 0:15 ` [PATCH 9/9] boot: imagemap: Copy cached data when moving a region Daniel Golle
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=cover.1794614777.git.daniel@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=alexey.brodkin@synopsys.com \
--cc=aristo.chen@canonical.com \
--cc=bmeng.cn@gmail.com \
--cc=daniel.schwierzeck@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=joaofl@gmail.com \
--cc=leo.liang@sifive.com \
--cc=me@ziyao.cc \
--cc=michal.simek@amd.com \
--cc=openwrt-devel@lists.openwrt.org \
--cc=sjg@chromium.org \
--cc=tim609@andestech.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=uboot-snps-arc@synopsys.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.