From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Thu, 25 Jun 2015 20:44:07 +0000 Subject: Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Message-Id: <6806026.xb91q6Ad7G@wuerfel> List-Id: References: <1434751712-24333-1-git-send-email-mcgrof@do-not-panic.com> <1435189081.3790.24.camel@kernel.crashing.org> <4985EFDD773FCB459EF7915D2A3621ADC02F10@nice.asicdesigners.com> In-Reply-To: <4985EFDD773FCB459EF7915D2A3621ADC02F10@nice.asicdesigners.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Casey Leedom Cc: Benjamin Herrenschmidt , "Luis R. Rodriguez" , "Michael S. Tsirkin" , Bjorn Helgaas , Toshi Kani , Andy Lutomirski , Juergen Gross , Tomi Valkeinen , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "xen-devel@lists.xensource.com" , linux-fbdev , Suresh Siddha , Ingo Molnar , Thomas Gleixner , Daniel Vetter , Dave Airlie , Antonino Daplas , Jean-Christophe Plagniol-Villard , Dave Hansen , "venkatesh.pallipadi@intel.com" , Stefan Bader , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , Mel Gorman , Vlastimil Babka , Borislav Petkov , Davidlohr Bueso , Konrad Rzeszutek Wilk , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , David Vrabel , Jan Beulich , Roger Pau =?ISO-8859-1?Q?Monn=E9?= On Thursday 25 June 2015 15:01:56 Casey Leedom wrote: > > Is there a reference I can read on this so I can understand > when and where we can use the __raw_*() APIs? Can these > Raw Read/Write operations be reordered with respect to > each other or are the use of the various flavors of SYNC > instructions just to maintain order between Cached Memory > Accesses and I/O Instructions? The interpretation is not consistent across architectures. My best description would be that the __raw_*() accessors should only be used for accessing RAM areas that are known to have no side-effects and can be read in any size (8-bit to 64-bit wide), any alignment, and do not have a specific endianess. If you are dealing with MMIO registers that have a fixed endianess and size, the correct accessor would be readl_relaxed(), which is like readl() but lacks the barriers on certain architectures. Arnd