linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Fwd: [PATCH] arch/powerpc: Improve _memcpy
@ 2009-11-03 19:30 Chris Friesen
  2009-11-04 18:12 ` Albrecht Dreß
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Friesen @ 2009-11-03 19:30 UTC (permalink / raw)
  To: Linux kernel, linuxppc-dev list, Dirk Eibach


Forwarding to the ppc mailing list.

Chris


-------- Original Message --------
Subject: [PATCH] arch/powerpc: Improve _memcpy
Date: Tue,  3 Nov 2009 15:20:56 +0100
From: Dirk Eibach <eibach@gdsys.de>
To: linux-kernel@vger.kernel.org
CC: Dirk Eibach <eibach@gdsys.de>

The implementation of _memcpy_fromio and _memcpy_toio seems to be
suboptimal for size 4.

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
---
 arch/powerpc/kernel/io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c
index 1882bf4..8dc7547 100644
--- a/arch/powerpc/kernel/io.c
+++ b/arch/powerpc/kernel/io.c
@@ -161,7 +161,7 @@ void _memcpy_fromio(void *dest, const volatile void
__iomem *src,
 		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 *dest, const
void *src, unsigned long n)
 		vdest++;
 		n--;
 	}
-	while(n > 4) {
+	while(n >= 4) {
 		*((volatile u32 *)vdest) = *((volatile u32 *)src);
 		src += 4;
 		vdest += 4;
-- 
1.5.6.5


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

* Re: Fwd: [PATCH] arch/powerpc: Improve _memcpy
  2009-11-03 19:30 Fwd: [PATCH] arch/powerpc: Improve _memcpy Chris Friesen
@ 2009-11-04 18:12 ` Albrecht Dreß
  2009-11-09 17:06   ` Grant Likely
  0 siblings, 1 reply; 3+ messages in thread
From: Albrecht Dreß @ 2009-11-04 18:12 UTC (permalink / raw)
  To: Chris Friesen, Grant Likely; +Cc: Dirk Eibach, linuxppc-dev list, Linux kernel

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

See <http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-May/072582.html>.   
Any chance to get this one into the tree?  Grant?

Cheers, Albrecht.

Am 03.11.09 20:30 schrieb(en) Chris Friesen:
> 
> Forwarding to the ppc mailing list.
> 
> Chris
> 
> 
> -------- Original Message --------
> Subject: [PATCH] arch/powerpc: Improve _memcpy
> Date: Tue,  3 Nov 2009 15:20:56 +0100
> From: Dirk Eibach <eibach@gdsys.de>
> To: linux-kernel@vger.kernel.org
> CC: Dirk Eibach <eibach@gdsys.de>
> 
> The implementation of _memcpy_fromio and _memcpy_toio seems to be
> suboptimal for size 4.
> 
> Signed-off-by: Dirk Eibach <eibach@gdsys.de>
> ---
>  arch/powerpc/kernel/io.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c
> index 1882bf4..8dc7547 100644
> --- a/arch/powerpc/kernel/io.c
> +++ b/arch/powerpc/kernel/io.c
> @@ -161,7 +161,7 @@ void _memcpy_fromio(void *dest, const volatile void
> __iomem *src,
>  		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 *dest, const
> void *src, unsigned long n)
>  		vdest++;
>  		n--;
>  	}
> -	while(n > 4) {
> +	while(n >= 4) {
>  		*((volatile u32 *)vdest) = *((volatile u32 *)src);
>  		src += 4;
>  		vdest += 4;
> --
> 1.5.6.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
> 
> 


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

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

* Re: Fwd: [PATCH] arch/powerpc: Improve _memcpy
  2009-11-04 18:12 ` Albrecht Dreß
@ 2009-11-09 17:06   ` Grant Likely
  0 siblings, 0 replies; 3+ messages in thread
From: Grant Likely @ 2009-11-09 17:06 UTC (permalink / raw)
  To: Albrecht Dreß; +Cc: Dirk Eibach, Linux kernel, linuxppc-dev list

On Wed, Nov 4, 2009 at 11:12 AM, Albrecht Dre=DF <albrecht.dress@arcor.de> =
wrote:
> See <http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-May/072582.html>=
.
> =A0Any chance to get this one into the tree? =A0Grant?

Even though it is generic ppc code, I picked it up into my 5200 -next
tree because it's such a simple patch.  I expect Ben will pull it into
his any day now.

Cheers,
g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

end of thread, other threads:[~2009-11-09 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 19:30 Fwd: [PATCH] arch/powerpc: Improve _memcpy Chris Friesen
2009-11-04 18:12 ` Albrecht Dreß
2009-11-09 17:06   ` Grant Likely

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