linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] powerpc: Remove eieio() in PowerPC IO functions
@ 2025-01-29  9:45 Julian Vetter
  2025-01-29 11:14 ` Segher Boessenkool
  0 siblings, 1 reply; 4+ messages in thread
From: Julian Vetter @ 2025-01-29  9:45 UTC (permalink / raw)
  To: Arnd Bergmann, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy, Naveen N Rao
  Cc: linuxppc-dev, linux-kernel, Julian Vetter

Remove the eieio() calls in IO functions for PowerPC. While other
architectures permit prefetching, combining, and reordering, the eieio()
calls on PowerPC prevent such optimizations. This has only historical
reasons, because in the early arch/powerpc64 code also readl() had these
eieio() calls, but later went through several iterations which
subsequently removed them. While the _memcpy_fromio and ins{b,l,w}
functions stayed with the old implementation.

Signed-off-by: Julian Vetter <julian@outer-limits.org>
---
Changes for v2:
- Removed eieio() calls also from other functions in io.c
- Rephrased commit message
---
 arch/powerpc/kernel/io.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c
index 6af535905984..d643ec4a201d 100644
--- a/arch/powerpc/kernel/io.c
+++ b/arch/powerpc/kernel/io.c
@@ -34,7 +34,6 @@ void _insb(const volatile u8 __iomem *port, void *buf, long count)
 	asm volatile("sync");
 	do {
 		tmp = *(const volatile u8 __force *)port;
-		eieio();
 		*tbuf++ = tmp;
 	} while (--count != 0);
 	asm volatile("twi 0,%0,0; isync" : : "r" (tmp));
@@ -65,7 +64,6 @@ void _insw_ns(const volatile u16 __iomem *port, void *buf, long count)
 	asm volatile("sync");
 	do {
 		tmp = *(const volatile u16 __force *)port;
-		eieio();
 		*tbuf++ = tmp;
 	} while (--count != 0);
 	asm volatile("twi 0,%0,0; isync" : : "r" (tmp));
@@ -96,7 +94,6 @@ void _insl_ns(const volatile u32 __iomem *port, void *buf, long count)
 	asm volatile("sync");
 	do {
 		tmp = *(const volatile u32 __force *)port;
-		eieio();
 		*tbuf++ = tmp;
 	} while (--count != 0);
 	asm volatile("twi 0,%0,0; isync" : : "r" (tmp));
@@ -155,21 +152,18 @@ void _memcpy_fromio(void *dest, const volatile void __iomem *src,
 	__asm__ __volatile__ ("sync" : : : "memory");
 	while(n && (!IO_CHECK_ALIGN(vsrc, 4) || !IO_CHECK_ALIGN(dest, 4))) {
 		*((u8 *)dest) = *((volatile u8 *)vsrc);
-		eieio();
 		vsrc++;
 		dest++;
 		n--;
 	}
 	while(n >= 4) {
 		*((u32 *)dest) = *((volatile u32 *)vsrc);
-		eieio();
 		vsrc += 4;
 		dest += 4;
 		n -= 4;
 	}
 	while(n) {
 		*((u8 *)dest) = *((volatile u8 *)vsrc);
-		eieio();
 		vsrc++;
 		dest++;
 		n--;
-- 
2.34.1



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

end of thread, other threads:[~2025-01-31  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29  9:45 [PATCH v2] powerpc: Remove eieio() in PowerPC IO functions Julian Vetter
2025-01-29 11:14 ` Segher Boessenkool
2025-01-29 13:12   ` Julian Vetter
2025-01-31  9:37   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).