linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: tiny memcpy_(to|from)io optimisation
@ 2009-05-27 20:00 Albrecht Dreß
  2009-05-28 16:13 ` Joakim Tjernlund
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Albrecht Dreß @ 2009-05-27 20:00 UTC (permalink / raw)
  To: Linux PPC Development

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

This trivial patch changes memcpy_(to|from)io as to transfer as many  
32-bit words as possible in 32-bit accesses (in the current solution,  
the last 32-bit word was transferred as 4 byte accesses).

Signed-off-by: Albrecht Dreß <albrecht.dress@arcor.de>
---

diff -urpN -X linux-2.6.29.1.orig/Documentation/dontdiff  
linux-2.6.29.1.orig/arch/powerpc/kernel/io.c  
linux-2.6.29.1/arch/powerpc/kernel/io.c
--- linux-2.6.29.1.orig/arch/powerpc/kernel/io.c	2009-04-02  
22:55:27.000000000 +0200
+++ linux-2.6.29.1/arch/powerpc/kernel/io.c	2009-05-27  
11:36:09.000000000 +0200
@@ -161,7 +161,7 @@ void _memcpy_fromio(void *dest, const vo
  		dest++;
  		n--;
  	}
-	while(n > 4) {
+	while(n >= 4) {
  		*((u32 *)dest) = *((volatile u32 *)vsrc);
  		eieio();
  		vsrc += 4;
@@ -190,7 +190,7 @@ void _memcpy_toio(volatile void __iomem
  		vdest++;
  		n--;
  	}
-	while(n > 4) {
+	while(n >= 4) {
  		*((volatile u32 *)vdest) = *((volatile u32 *)src);
  		src += 4;
  		vdest += 4;

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2009-06-19 18:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 20:00 [PATCH] powerpc: tiny memcpy_(to|from)io optimisation Albrecht Dreß
2009-05-28 16:13 ` Joakim Tjernlund
2009-05-28 19:50   ` Albrecht Dreß
2009-05-29  6:31     ` Joakim Tjernlund
2009-05-31 10:11       ` Albrecht Dreß
2009-06-01  6:14         ` Joakim Tjernlund
2009-06-02 18:45           ` Albrecht Dreß
2009-06-02 22:51             ` Benjamin Herrenschmidt
2009-06-03 14:36               ` Kenneth Johansson
2009-06-03 18:35                 ` Albrecht Dreß
2009-06-11 17:07 ` Wolfram Sang
2009-06-11 17:30 ` Grant Likely
2009-06-19 18:42 ` Lorenz Kolb

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).