[PATCH] powerpc: tiny memcpy_(to|from)io optimisation

Grant Likely grant.likely at secretlab.ca
Fri Jun 12 03:30:11 EST 2009


On Wed, May 27, 2009 at 2:00 PM, Albrecht Dreß<albrecht.dress at arcor.de> wrote:
> 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 at arcor.de>
Acked-by: Grant Likely <grant.likely at secretlab.ca>

> ---
>
> 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;
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>



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


More information about the Linuxppc-dev mailing list