All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] imagemap: Fix boot errors and resource lifetimes
@ 2026-11-14  0:08 Daniel Golle
  2026-11-14  0:09 ` [PATCH 1/9] boot: Return distinct errors for ordinary bootm failures Daniel Golle
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Daniel Golle @ 2026-11-14  0:08 UTC (permalink / raw)
  To: Alexey Brodkin, Eugeniy Paltsev, Tom Rini, Ilias Apalodimas,
	Michal Simek, Daniel Schwierzeck, Tim Ouyang, Leo Liang, Yao Zi,
	Simon Glass, Bin Meng, Daniel Golle, Aristo Chen,
	João Loureiro, uboot-snps-arc, u-boot, openwrt-devel

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

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

end of thread, other threads:[~2026-11-14  0:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14  0:08 [PATCH 0/9] imagemap: Fix boot errors and resource lifetimes Daniel Golle
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

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.