mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jiri Slaby <jirislaby@gmail.com>, Pekka Paalanen <pq@iki.fi>,
	linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	lethal@linux-sh.org, linux-sh@vger.kernel.org
Subject: Re: Do cpu-endian MMIO accessors exist?
Date: Wed, 22 Jul 2009 09:43:09 +0100	[thread overview]
Message-ID: <20090722094309.10b25290@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <200907221035.50025.arnd@arndb.de>

On Wed, 22 Jul 2009 10:35:49 +0200
Arnd Bergmann <arnd@arndb.de> wrote:

> On Wednesday 22 July 2009, Jiri Slaby wrote:
> > No, I should have written this explicitly. I meant read* have a barrier,
> > whereas ioread* do not. Similarly for writes. Is this expected?
> > 
> > For example:
> > #define __raw_readl(a) (__chk_io_ptr(a), *(volatile u32 __force *)(a))
> > #define readl(a)       ({ u32 r_ = __raw_readl(a); mb(); r_; })
> > #define ioread32(a)    __raw_readl(a)
> 
> No, this looks like a bug. I would have expected
> 
> #define ioread32(a)    readl(a)
> 
> in this case. Also, ioread32 should actually multiplex between
> readl() and inl() based on the address token, as the code in
> lib/iomap.c does. It's probably easy enough to enable
> CONFIG_GENERIC_IOMAP on sh, and remove the ioread*/iowrite*
> macros from arch/sh/include/asm/io.h.

If your platform is purely MMIO based then ioread32 and readl can become
the same thing, which is much more efficient. Even if you have port based
devices that are mapped as MMIO surely its more efficient to do the
relevant address tweaking in the iomap not in the read ?

  reply	other threads:[~2009-07-22  8:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 20:42 Pekka Paalanen
2009-07-21 20:59 ` Jiri Slaby
2009-07-21 21:15   ` Arnd Bergmann
2009-07-21 21:33     ` Christoph Hellwig
2009-07-21 22:01       ` Arnd Bergmann
2009-07-22 17:11         ` Pekka Paalanen
2009-07-22 21:19           ` Arnd Bergmann
2009-07-23 16:23             ` Pekka Paalanen
2009-07-22 21:20           ` Arnd Bergmann
2009-07-21 21:56     ` Jiri Slaby
2009-07-21 22:05       ` Arnd Bergmann
2009-07-22  7:24         ` Jiri Slaby
2009-07-22  8:35           ` Arnd Bergmann
2009-07-22  8:43             ` Alan Cox [this message]
2009-07-22 13:44               ` Arnd Bergmann
2009-07-27  5:00                 ` Paul Mundt

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=20090722094309.10b25290@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=hch@infradead.org \
    --cc=jirislaby@gmail.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=pq@iki.fi \
    /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

all inboxes | Powered by JetHome®