[PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics

From: Sang-Heon Jeon

Date: Wed Jul 08 2026 - 13:13:06 EST


__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@xxxxxxxxx>
---
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