Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: arm64 memcpy_{from|to}io and memset_io
Date: Wed, 14 Oct 2015 10:17:12 +0200	[thread overview]
Message-ID: <5350512.KZVKFguTOb@wuerfel> (raw)
In-Reply-To: <CAC8NTUUgQk0CNaBj2p=38U+yyFWE6ZQkSgs1KA=MviQg3g_X=Q@mail.gmail.com>

On Tuesday 13 October 2015 23:12:18 Radha Mohan wrote:
> Hi,
> I see that the memcpy_{from|to}io and memset_io are not in an
> optimized manner. I guess these are just a copy from
> arch/arm/include/asm/io.h where there could be problem with different
> implementations.
> Do we still need these to be byte write ?

No.

> Can we convert them to use a more optimized memcpy ?

Yes.

> We have some drivers, like framebuffer driver using these functions
> and end up writing byte-by-byte. This causes a very poor VGA
> performance.
> 
> Let me know if there are any concerns to convert these to use memcpy.
> I can send a patch.

A few things to watch out for:

- you cannot use a static inline to do the job, because gcc might
  replace a plain memcpy() with unaligned pointer dereferences
  that are not allowed on __iomem

- when providing an external implementation of the functions, make sure
  they honor the alignment as well

- I think you need the same barriers that readl/writel have, but only
  at the start/end of the loop, not in the middle.

	Arnd

  reply	other threads:[~2015-10-14  8:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14  6:12 arm64 memcpy_{from|to}io and memset_io Radha Mohan
2015-10-14  8:17 ` Arnd Bergmann [this message]
2015-10-14 16:12 ` Catalin Marinas
2015-10-14 16:16   ` Radha Mohan

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=5350512.KZVKFguTOb@wuerfel \
    --to=arnd@arndb.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox