[PATCH] ppc: fix missing cache maintenance before mapping uncached
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Jul 2 05:03:41 PDT 2025
flags is the generic map type (e.g. MAP_CACHED), while MAS2_I is a bit
only relevant to PowerPC. Checking for MAS2_I in flags is thus never
true and means we skipped cache maintenance so far when remapping a
region as uncached.
We actually have a test that caught similar issues on ARM, but we don't
have a Labgrid config for CI to test on PowerPC unfortunately.
Interestingly, the fixed behavior had only been in barebox for a year,
before it was subtly broken for 10 years...
Fixes: b792124a7dd3 ("rework remap_range")
Cc: Renaud Barbier <Renaud.Barbier at ametek.com>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
arch/powerpc/cpu-85xx/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/cpu-85xx/mmu.c b/arch/powerpc/cpu-85xx/mmu.c
index b484acbf8043..3bd75281eb98 100644
--- a/arch/powerpc/cpu-85xx/mmu.c
+++ b/arch/powerpc/cpu-85xx/mmu.c
@@ -47,7 +47,7 @@ int arch_remap_range(void *virt_addr, phys_addr_t phys_addr, size_t size, unsign
break;
e500_read_tlbcam_entry(esel, &valid, &tsize, &epn,
&rpn);
- if (flags & MAS2_I) {
+ if (pte_flags & MAS2_I) {
flush_dcache();
invalidate_icache();
}
--
2.39.5
More information about the barebox
mailing list