From: Lorenz Kolb <lorenz@missinglinkelectronics.com>
To: "Albrecht Dreß" <albrecht.dress@arcor.de>
Cc: Linux PPC Development <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] powerpc: tiny memcpy_(to|from)io optimisation
Date: Fri, 19 Jun 2009 20:42:33 +0200 [thread overview]
Message-ID: <4A3BDC19.7060704@missinglinkelectronics.com> (raw)
In-Reply-To: <1243454441.3489.1@antares>
Albrecht Dreß 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@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;
>
>
> ------------------------------------------------------------------------
Works for me (and some custom hardware I created [quite a while ago,
when I was young ;-)] that is not very tolerant to Byte-by-Byte-Transfers).
Thus:
Acked
prev parent reply other threads:[~2009-06-19 18:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A3BDC19.7060704@missinglinkelectronics.com \
--to=lorenz@missinglinkelectronics.com \
--cc=albrecht.dress@arcor.de \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.