From: dirk.behme@de.bosch.com (Dirk Behme)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: optimize memset_io()/memcpy_fromio()/memcpy_toio()
Date: Wed, 5 Jun 2013 08:02:16 +0200 [thread overview]
Message-ID: <51AED468.9040109@de.bosch.com> (raw)
In-Reply-To: <E1THMAC-0004nL-8B@rmk-PC.arm.linux.org.uk>
On 28.09.2012 00:02, Russell King wrote:
> If we are building for a LE platform, and we haven't overriden the
> MMIO ops, then we can optimize the mem*io operations using the
> standard string functions.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> arch/arm/include/asm/io.h | 25 +++++++++++++++++++++++++
> 1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
> index 815c669..ed0577e 100644
> --- a/arch/arm/include/asm/io.h
> +++ b/arch/arm/include/asm/io.h
> @@ -23,6 +23,7 @@
>
> #ifdef __KERNEL__
>
> +#include <linux/string.h>
> #include <linux/types.h>
> #include <asm/byteorder.h>
> #include <asm/memory.h>
> @@ -249,9 +250,33 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
> #define writesw(p,d,l) __raw_writesw(p,d,l)
> #define writesl(p,d,l) __raw_writesl(p,d,l)
>
> +#ifndef __ARMBE__
> +static inline void memset_io(volatile void __iomem *dst, unsigned c,
> + size_t count)
> +{
> + memset((void __force *)dst, c, count);
> +}
> +#define memset_io(dst,c,count) memset_io(dst,c,count)
> +
> +static inline void memcpy_fromio(void *to, const volatile void __iomem *from,
> + size_t count)
> +{
> + memcpy(to, (const void __force *)from, count);
> +}
> +#define memcpy_fromio(to,from,count) memcpy_fromio(to,from,count)
> +
> +static inline void memcpy_toio(volatile void __iomem *to, const void *from,
> + size_t count)
> +{
> + memcpy((void __force *)to, from, count);
> +}
> +#define memcpy_toio(to,from,count) memcpy_toio(to,from,count)
> +
> +#else
> #define memset_io(c,v,l) _memset_io(c,(v),(l))
> #define memcpy_fromio(a,c,l) _memcpy_fromio((a),c,(l))
> #define memcpy_toio(c,a,l) _memcpy_toio(c,(a),(l))
> +#endif
>
> #endif /* readl */
I'd like to ask if there is any chance to get anything like this or the
even older proposal
http://lists.infradead.org/pipermail/linux-arm-kernel/2009-November/004077.html
merged? Maybe an updated version incorporating the discussion conclusions?
In the discussion of
http://lists.infradead.org/pipermail/linux-arm-kernel/2009-November/004077.html
there have been some doubts if it's a good idea to enable it for all
SoCs. Therefore that patch introduced a
config OPTIMIZED_IOMEM_MEMCPY
which would allow us to enable it for only known to be compatible SoCs.
Just in case this helps to get it applied ;)
Many thanks and best regards
Dirk
next prev parent reply other threads:[~2013-06-05 6:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 22:02 [PATCH] ARM: optimize memset_io()/memcpy_fromio()/memcpy_toio() Russell King
2012-09-28 4:17 ` Nicolas Pitre
2012-09-28 9:58 ` Will Deacon
2012-09-28 10:31 ` Russell King - ARM Linux
2012-09-28 10:42 ` Will Deacon
2012-09-28 10:44 ` Russell King - ARM Linux
2012-09-28 13:36 ` Arnd Bergmann
2012-09-28 14:13 ` Catalin Marinas
2012-09-28 14:29 ` Russell King - ARM Linux
2013-06-05 6:02 ` Dirk Behme [this message]
2013-06-11 18:16 ` Dirk Behme
2013-06-13 11:05 ` Russell King - ARM Linux
2013-06-13 12:47 ` Arnd Bergmann
2013-06-13 17:13 ` Russell King - ARM Linux
2013-06-23 6:46 ` Dirk Behme
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=51AED468.9040109@de.bosch.com \
--to=dirk.behme@de.bosch.com \
--cc=linux-arm-kernel@lists.infradead.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.