From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: akpm@linux-foundation.org, David Hildenbrand <david@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>
Cc: linux-mm@kvack.org, Sang-Heon Jeon <ekffu200098@gmail.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Catalin Marinas <catalin.marinas@arm.com>,
"Liam R. Howlett" <liam@infradead.org>,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
Lorenzo Stoakes <ljs@kernel.org>, Michal Hocko <mhocko@suse.com>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Vlastimil Babka <vbabka@kernel.org>,
Will Deacon <will@kernel.org>
Subject: [PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics
Date: Thu, 9 Jul 2026 02:06:45 +0900 [thread overview]
Message-ID: <20260708170647.362562-2-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260708170647.362562-1-ekffu200098@gmail.com>
__late_set_fixmap() and __late_clear_fixmap() are only used after
early_ioremap_reset() has been called.
arm64, riscv and powerpc all have a __set_fixmap() that works before
and after paging_init(), so they do not need to call
early_ioremap_reset() or define the macros, but they describe the same
situation in three different ways:
calls reset defines the macros
arm64 yes yes
riscv no yes
powerpc no no
The existing comment is vague and allows all three. Replace it with
comments that make it clear when the reset and the macros are needed.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
mm/early_ioremap.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
index 96c29b9dc85d..6215b90dfef3 100644
--- a/mm/early_ioremap.c
+++ b/mm/early_ioremap.c
@@ -47,15 +47,19 @@ pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr,
return prot;
}
+/*
+ * Only architectures whose early_ioremap() must stop using __early_set_fixmap()
+ * after paging_init() need to call this.
+ */
void __init early_ioremap_reset(void)
{
after_paging_init = 1;
}
/*
- * Generally, ioremap() is available after paging_init() has been called.
- * Architectures wanting to allow early_ioremap after paging_init() can
- * define __late_set_fixmap and __late_clear_fixmap to do the right thing.
+ * Only architectures that call early_ioremap_reset() need to define
+ * __late_set_fixmap() and __late_clear_fixmap(), which early_ioremap() uses
+ * instead of __early_set_fixmap() after the reset.
*/
#ifndef __late_set_fixmap
static inline void __init __late_set_fixmap(enum fixed_addresses idx,
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-07-08 17:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 17:06 [PATCH 0/3] mm/early_ioremap: clarify and clean up early_ioremap_reset() Sang-Heon Jeon
2026-07-08 17:06 ` Sang-Heon Jeon [this message]
2026-07-08 17:06 ` [PATCH 2/3] riscv: remove unused __late_set_fixmap() and __late_clear_fixmap() Sang-Heon Jeon
2026-07-08 17:06 ` [PATCH 3/3] arm64: remove early_ioremap_reset() call and __late_* macros Sang-Heon Jeon
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=20260708170647.362562-2-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=catalin.marinas@arm.com \
--cc=david@kernel.org \
--cc=liam@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=will@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