From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751812AbbFYUxM (ORCPT ); Thu, 25 Jun 2015 16:53:12 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:52763 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751201AbbFYUxI (ORCPT ); Thu, 25 Jun 2015 16:53:08 -0400 From: Arnd Bergmann 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?= Subject: Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Date: Thu, 25 Jun 2015 22:44:07 +0200 Message-ID: <6806026.xb91q6Ad7G@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <4985EFDD773FCB459EF7915D2A3621ADC02F10@nice.asicdesigners.com> References: <1434751712-24333-1-git-send-email-mcgrof@do-not-panic.com> <1435189081.3790.24.camel@kernel.crashing.org> <4985EFDD773FCB459EF7915D2A3621ADC02F10@nice.asicdesigners.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Rp+9YmvJ4eSexgpMC4nXp5ZIAYzVrEs2OLqu9K80sahQfu+SAT1 dqminvxBb7LkuoND3eQ3kcM72/PjVsr9G5wlUIh8yQ76RjgNpJhz3Nkg0QfcqgdQGnz/l4i W+BkzFR8a0A2yvTQEokhdiRhR+hAxQJ9LK7US14SehLqKICC8daEeXACm+dYkXS6zRM1D+W Yh9HECjvteb+i1aq34q4Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:rGgKTHS23rg=:wJF+YjqzBoUAcpYUc/ZBhp SRWR3uJ3e7+gyvwWylDzCU7ah4qR9xSrRQAFVP7HdG8D1YlOvFjQ74DVMJv2YXXz0/fhKK+Wx LMVR2SzHGVlnHXEyTs4o4LXjOYxgi2NB3ThmQ8e1GslN8TSAHNFtItPuDOKtR9HZQ8lN9yw7v Qzhv/V2XtYeHaApoSWyJFupJTVbsGFAKhLyKsV0/e/Es5mNTfZ4q91H+RDuNtYWJUb3hdKirc DDc2sMhc3RfCds+szg+glqN3l7KYUvOmWmHCczyLz4vZwCUNAy7chqZpE9nUfRyiiigUW9ipW bM+a0w7YPSro7G1umiJxtj1IEO++XVXDJQA85kPUIrMlplAiFtBvky1jc7sguqWQEKRm+lo1N dzWkSIcBhc2imAW+AkAT/X0yA8v/xjTX/R96Ka597GnFNi/tGDYrGyjMCPQt6FTaV5ifkpM1x 4Wib6/aJAGLCaxy018IgzkRLhaqJ/ZO6B+xcpLrJuI8bOW55d0MyTPewuw4zHegeQfAzKDqpb XC0nUuvF/q1sJHTbH3ZUQdIcQZE4gmJ6SzVJgvXc+U7yVUXsAlyccAOZcOfcZeL6UqyvLzK4N A9NJ1Sq6LrHbhJ9q+ggm1xyzk2I4hzlo9/mKOdhd5lep7aHz3yeY2DIKQx4e2oadv51pS+WBg tSkbAmkY+Ye5yFj6dvm7nh0oCaqKbmpm4HHalKK28k77VoQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Date: Thu, 25 Jun 2015 22:44:07 +0200 Message-ID: <6806026.xb91q6Ad7G@wuerfel> References: <1434751712-24333-1-git-send-email-mcgrof@do-not-panic.com> <1435189081.3790.24.camel@kernel.crashing.org> <4985EFDD773FCB459EF7915D2A3621ADC02F10@nice.asicdesigners.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4985EFDD773FCB459EF7915D2A3621ADC02F10@nice.asicdesigners.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Casey Leedom Cc: linux-fbdev , "Michael S. Tsirkin" , Benjamin Herrenschmidt , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , Dave Hansen , "linux-pci@vger.kernel.org" , Jan Beulich , Ville =?ISO-8859-1?Q?Syrj=E4l=E4?= , "xen-devel@lists.xensource.com" , Davidlohr Bueso , Tomi Valkeinen , Mel Gorman , Suresh Siddha , Dave Airlie , Ingo Molnar , Borislav Petkov , Jean-Christophe Plagniol-Villard , Antonino Daplas , "Luis R. Rodriguez" , Stefan Bader , Daniel Vetter List-Id: xen-devel@lists.xenproject.org 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