[PATCH] ARM: cpu: disable interrupts before MMU disabling
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Dec 11 12:43:13 PST 2025
The cache maintenance operations we do in mmu_disable() won't take
kindly to being interrupted by interrupt handlers if we have any.
Thus disable them first thing and also move the #ifdef into the header
while at it.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
arch/arm/cpu/cpu.c | 6 +++---
arch/arm/include/asm/mmu.h | 5 +++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/arm/cpu/cpu.c b/arch/arm/cpu/cpu.c
index 0293181811b6..0c678f54c023 100644
--- a/arch/arm/cpu/cpu.c
+++ b/arch/arm/cpu/cpu.c
@@ -88,12 +88,12 @@ static void arch_shutdown(void)
if (efi_is_payload())
return;
-#ifdef CONFIG_MMU
+ disable_interrupts();
+
mmu_disable();
-#endif
+
icache_invalidate();
- disable_interrupts();
}
archshutdown_exitcall(arch_shutdown);
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index 1fafbf9d77be..bcaa984a40ed 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -10,7 +10,12 @@
struct arm_memory;
+#ifdef CONFIG_MMU
void mmu_disable(void);
+#else
+static inline void mmu_disable(void) {}
+#endif
+
static inline void arm_create_section(unsigned long virt, unsigned long phys, int size_m,
unsigned int flags)
{
--
2.47.3
More information about the barebox
mailing list