public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [RFC PATCH] m68k: nommu: Fix behaviour of io macros on non-CF
@ 2026-04-04  2:46 Daniel Palmer
  2026-04-13 16:52 ` Arnd Bergmann
  2026-04-14 12:18 ` Greg Ungerer
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Palmer @ 2026-04-04  2:46 UTC (permalink / raw)
  To: gerg
  Cc: geert, christoph.plattner, linux-m68k, linux-kernel, arnd,
	Daniel Palmer

Currently for 68000 readl() and friends are broken in that they
return the value from the bus as-is but should be reading a little
endian value and swapping it to big endian.

This was found using virtio-mmio on a 68000 virt machine. virtio-mmio
is little endian even if the emulated machine is big endian. This works
for MMU m68k because the io macros do what is expected there, but if
the kernel was built for nommu it breaks.

Potentially this will break some stuff for nommu non-CF m68k users
but since there are probably 2 or 3 of us in the world I think we
can work it out.

Suggested-by: Arnd Bergmann <arnd@kernel.org>
Link: https://lore.kernel.org/lkml/ada73dc9-edf5-458c-8849-9f9db23ff304@app.fastmail.com/
Signed-off-by: Daniel Palmer <daniel@0x0f.com>
---
 arch/m68k/include/asm/io_no.h | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
index 516371d5587a..c39db8798ef2 100644
--- a/arch/m68k/include/asm/io_no.h
+++ b/arch/m68k/include/asm/io_no.h
@@ -96,15 +96,6 @@ static inline void writel(u32 value, volatile void __iomem *addr)
 		__raw_writel(swab32(value), addr);
 }
 
-#else
-
-#define readb __raw_readb
-#define readw __raw_readw
-#define readl __raw_readl
-#define writeb __raw_writeb
-#define writew __raw_writew
-#define writel __raw_writel
-
 #endif /* IOMEMBASE */
 
 #if defined(CONFIG_PCI)
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-04-15 14:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-04  2:46 [RFC PATCH] m68k: nommu: Fix behaviour of io macros on non-CF Daniel Palmer
2026-04-13 16:52 ` Arnd Bergmann
2026-04-14  7:14   ` Geert Uytterhoeven
2026-04-14 12:18 ` Greg Ungerer
2026-04-14 12:55   ` Daniel Palmer
2026-04-14 13:24     ` Arnd Bergmann
2026-04-15 13:52       ` Greg Ungerer
2026-04-15 14:54         ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox