* [PATCH 0/3] mm/early_ioremap: clarify and clean up early_ioremap_reset()
@ 2026-07-08 17:06 Sang-Heon Jeon
2026-07-08 17:06 ` [PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics Sang-Heon Jeon
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sang-Heon Jeon @ 2026-07-08 17:06 UTC (permalink / raw)
To: akpm, Albert Ou, Catalin Marinas, David Hildenbrand,
Palmer Dabbelt, Paul Walmsley, Will Deacon
Cc: linux-mm, Sang-Heon Jeon, Alexandre Ghiti, Liam R. Howlett,
linux-arm-kernel, linux-kernel, linux-riscv, linuxppc-dev,
Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Suren Baghdasaryan,
Vlastimil Babka
__late_set_fixmap() and __late_clear_fixmap() are only used after
early_ioremap_reset() has been called, but the comment above them does
not say anything about that. So arm64, riscv and powerpc, whose
__set_fixmap() works before and after paging_init(), describe the same
situation in three different ways:
calls reset defines the macros
arm64 yes yes
riscv no yes
powerpc no no
Patch 1 documents when early_ioremap_reset() needs to be called and
that only architectures calling it need to define the macros.
Patches 2 and 3 remove the unneeded riscv macros, which are
unreachable, and the arm64 reset call and macros, which change
nothing.
No functional change.
Sang-Heon Jeon (3):
mm/early_ioremap: clarify early_ioremap_reset() semantics
riscv: remove unused __late_set_fixmap() and __late_clear_fixmap()
arm64: remove early_ioremap_reset() call and __late_* macros
arch/arm64/include/asm/fixmap.h | 3 ---
arch/arm64/kernel/setup.c | 2 --
arch/riscv/include/asm/fixmap.h | 3 ---
mm/early_ioremap.c | 10 +++++++---
4 files changed, 7 insertions(+), 11 deletions(-)
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics
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
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
2 siblings, 0 replies; 4+ messages in thread
From: Sang-Heon Jeon @ 2026-07-08 17:06 UTC (permalink / raw)
To: akpm, David Hildenbrand, Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: linux-mm, Sang-Heon Jeon, Alexandre Ghiti, Catalin Marinas,
Liam R. Howlett, linux-kernel, linux-riscv, Lorenzo Stoakes,
Michal Hocko, Mike Rapoport, Suren Baghdasaryan, Vlastimil Babka,
Will Deacon
__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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] riscv: remove unused __late_set_fixmap() and __late_clear_fixmap()
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 ` [PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics Sang-Heon Jeon
@ 2026-07-08 17:06 ` Sang-Heon Jeon
2026-07-08 17:06 ` [PATCH 3/3] arm64: remove early_ioremap_reset() call and __late_* macros Sang-Heon Jeon
2 siblings, 0 replies; 4+ messages in thread
From: Sang-Heon Jeon @ 2026-07-08 17:06 UTC (permalink / raw)
To: akpm, Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: linux-mm, Sang-Heon Jeon, Alexandre Ghiti, Catalin Marinas,
David Hildenbrand, linux-kernel, linux-riscv, Will Deacon
__late_set_fixmap() and __late_clear_fixmap() are only used after
early_ioremap_reset() has been called. riscv never calls it because
__set_fixmap() works before and after paging_init(). So remove them.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
arch/riscv/include/asm/fixmap.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/riscv/include/asm/fixmap.h b/arch/riscv/include/asm/fixmap.h
index 0a55099bb734..a81823c5ee4a 100644
--- a/arch/riscv/include/asm/fixmap.h
+++ b/arch/riscv/include/asm/fixmap.h
@@ -55,9 +55,6 @@ enum fixed_addresses {
#define __early_set_fixmap __set_fixmap
-#define __late_set_fixmap __set_fixmap
-#define __late_clear_fixmap(idx) __set_fixmap((idx), 0, FIXMAP_PAGE_CLEAR)
-
extern void __set_fixmap(enum fixed_addresses idx,
phys_addr_t phys, pgprot_t prot);
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] arm64: remove early_ioremap_reset() call and __late_* macros
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 ` [PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics Sang-Heon Jeon
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 ` Sang-Heon Jeon
2 siblings, 0 replies; 4+ messages in thread
From: Sang-Heon Jeon @ 2026-07-08 17:06 UTC (permalink / raw)
To: akpm, Catalin Marinas, Will Deacon, Paul Walmsley, Palmer Dabbelt,
Albert Ou
Cc: linux-mm, Sang-Heon Jeon, Alexandre Ghiti, David Hildenbrand,
linux-arm-kernel, linux-kernel, linux-riscv
On arm64, __early_set_fixmap(), __late_set_fixmap() and
__late_clear_fixmap() are all __set_fixmap(). Calling
early_ioremap_reset() changes nothing. So remove the call and the
macros.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
arch/arm64/include/asm/fixmap.h | 3 ---
arch/arm64/kernel/setup.c | 2 --
2 files changed, 5 deletions(-)
diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h
index 65555284446e..abd9800aabf7 100644
--- a/arch/arm64/include/asm/fixmap.h
+++ b/arch/arm64/include/asm/fixmap.h
@@ -110,9 +110,6 @@ void __init early_fixmap_init(void);
#define __early_set_fixmap __set_fixmap
-#define __late_set_fixmap __set_fixmap
-#define __late_clear_fixmap(idx) __set_fixmap((idx), 0, FIXMAP_PAGE_CLEAR)
-
extern void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot);
#include <asm-generic/fixmap.h>
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 23c05dc7a8f2..29c6100f0c50 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -347,8 +347,6 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p)
request_standard_resources();
- early_ioremap_reset();
-
if (acpi_disabled)
psci_dt_init();
else
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-08 17:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 1/3] mm/early_ioremap: clarify early_ioremap_reset() semantics Sang-Heon Jeon
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox