[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0BFBJhDmS5r3O_x8d8Ws18vxresaULPBoN3JX49_LT3g@mail.gmail.com>
Date: Wed, 17 May 2017 23:40:12 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Chris Packham <Chris.Packham@...iedtelesis.co.nz>
Cc: Borislav Petkov <bp@...en8.de>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"mchehab@...nel.org" <mchehab@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] EDAC: mv64x60: replace in_le32/out_le32 with ioread32/iowrite32
On Wed, May 17, 2017 at 11:16 PM, Chris Packham
<Chris.Packham@...iedtelesis.co.nz> wrote:
> On 18/05/17 06:18, Borislav Petkov wrote:
> One thing I would like confirmation on is is in_le32 -> ioread32 the
> correct change? I tossed up between ioread32 and readl. Looking at
> mv643xx_eth.c which supports both the MV643XX and Orion it's using readl
> so perhaps I should be using that.
There is no easy answer: on powerpc, readl is used for PCI,
while in_le32 is used for on-chip devices, so in_le32 is the
right one in principle. The main difference is that readl can
work with CONFIG_EEH on pseries, but in_le32 is cheaper.
On ARM and most other architectures, readl is used for both
PCI and on-chip devices, so that's what portable code tends
to use.
ioread32 is required to behave the same way as readl
on all __iomem pointers returned from ioremap(), but
is an extern function on powerpc and can be more
expensive when CONFIG_GENERIC_IOMAP is set.
I'd go with readl() in this case.
Arnd
Powered by blists - more mailing lists