From: Wandun Chen <chenwandun1@gmail.com>
To: robh@kernel.org, saravanak@kernel.org, rppt@kernel.org,
m.szyprowski@samsung.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: akpm@linux-foundation.org
Subject: [PATCH v2 0/5] of: reserved_mem: several fixes about reserved memory
Date: Tue, 18 Aug 2026 17:24:15 +0800 [thread overview]
Message-ID: <20260818092420.2859026-1-chenwandun1@gmail.com> (raw)
From: Wandun Chen <chenwandun@lixiang.com>
This series fixes several error-handling issues in the reserved-memory
initialization paths.
Static reserved-memory nodes are reserved during the early DT scan but
initialized later. The first patch prevents a node whose early
reservation failed from reaching the late initialization path.
The following two patches reject overlapping static regions. Without
these checks, overlapping nodes can be initialized over the same
physical memory, result in data corrupt.
The last two patches fix cleanup of no-map regions after driver.
Sashiko reported these issues in [1] [2] [3].
[1] https://sashiko.dev/#/message/20260814090305.4C8741F00A3D%40smtp.kernel.org
[2] https://sashiko.dev/#/message/20260814084718.29C341F000E9%40smtp.kernel.org
[3] https://sashiko.dev/#/message/20260806100605.2C2C01F000E9%40smtp.kernel.org
v1 --> v2:
1. Rework failed-node tracking in patch 1: do not track zero-sized nodes,
and keep a reserved_mem slot when tracking overflows.
2. Reject static reserved regions overlapping existing no-map regions.
3. Keep MEMBLOCK_NOMAP flag for static no-map regions when init failure.
Wandun Chen (5):
of: reserved_mem: skip init for regions whose early reservation failed
of: reserved_mem: reject static regions overlapping no-map memory
of: reserved_mem: reject statically placed regions overlapping
existing reservations
of: reserved_mem: release dynamically allocated no-map region on init
failure
of: reserved_mem: retain static no-map memory on init failure
drivers/of/of_reserved_mem.c | 87 +++++++++++++++++++++++++++++-------
include/linux/memblock.h | 1 +
mm/memblock.c | 14 ++++++
3 files changed, 85 insertions(+), 17 deletions(-)
--
2.43.0
next reply other threads:[~2026-08-18 9:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 9:24 Wandun Chen [this message]
2026-08-18 9:24 ` [PATCH v2 1/5] of: reserved_mem: skip init for regions whose early reservation failed Wandun Chen
2026-08-18 9:24 ` [PATCH v2 2/5] of: reserved_mem: reject static regions overlapping no-map memory Wandun Chen
2026-08-18 9:40 ` sashiko-bot
2026-08-18 9:24 ` [PATCH v2 3/5] of: reserved_mem: reject statically placed regions overlapping existing reservations Wandun Chen
2026-08-18 9:41 ` sashiko-bot
2026-08-18 9:24 ` [PATCH v2 4/5] of: reserved_mem: release dynamically allocated no-map region on init failure Wandun Chen
2026-08-18 9:38 ` sashiko-bot
2026-08-18 9:24 ` [PATCH v2 5/5] of: reserved_mem: retain static no-map memory " Wandun Chen
2026-08-18 9:34 ` sashiko-bot
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=20260818092420.2859026-1-chenwandun1@gmail.com \
--to=chenwandun1@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=m.szyprowski@samsung.com \
--cc=robh@kernel.org \
--cc=rppt@kernel.org \
--cc=saravanak@kernel.org \
/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