[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090722094309.10b25290@lxorguk.ukuu.org.uk>
Date: Wed, 22 Jul 2009 09:43:09 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Arnd Bergmann <arnd@...db.de>
Cc: Jiri Slaby <jirislaby@...il.com>, Pekka Paalanen <pq@....fi>,
linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>, lethal@...ux-sh.org,
linux-sh@...r.kernel.org
Subject: Re: Do cpu-endian MMIO accessors exist?
On Wed, 22 Jul 2009 10:35:49 +0200
Arnd Bergmann <arnd@...db.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 ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists