From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755643AbdESOB3 (ORCPT ); Fri, 19 May 2017 10:01:29 -0400 Received: from smtp-out6.electric.net ([192.162.217.194]:56626 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbdESOB1 (ORCPT ); Fri, 19 May 2017 10:01:27 -0400 From: David Laight To: "'Arnd Bergmann'" , Chris Packham CC: "linuxppc-dev@lists.ozlabs.org" , "mchehab@kernel.org" , Borislav Petkov , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" Subject: RE: [PATCH 3/3] EDAC: mv64x60: replace in_le32/out_le32 with ioread32/iowrite32 Thread-Topic: [PATCH 3/3] EDAC: mv64x60: replace in_le32/out_le32 with ioread32/iowrite32 Thread-Index: AQHSz1ZWJon6IerjsUeb9iQqZXBwwaH7sM4g Date: Fri, 19 May 2017 14:01:04 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFFAB9B@AcuExch.aculab.com> References: <20170512042002.18524-1-chris.packham@alliedtelesis.co.nz> <20170512042002.18524-4-chris.packham@alliedtelesis.co.nz> <20170517181021.yfctrok7f25d5bu5@pd.tnic> <7c7bfec63342409ebd58913836a0739a@svr-chch-ex1.atlnz.lc> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v4JE1jAI013975 From: Arnd Bergmann > Sent: 17 May 2017 22:40 > > On Wed, May 17, 2017 at 11:16 PM, Chris Packham > 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. What about x86? Isn't ioread32() an extern function that checks for 'io' addresses than need 'inb' (etc) instructions rather than memory ones. If we know a PCI slave isn't 'io' should be be using ioread32() or readl()? Don't some architectures have different enforced barriers in both these? David