From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: RFC on writel and writel_relaxed Date: Tue, 27 Mar 2018 09:42:31 +1100 Message-ID: <1522104151.7364.23.camel@kernel.crashing.org> References: <1521854626.16434.359.camel@kernel.crashing.org> <58ce5b83f40f4775bec1be8db66adb0d@AcuMS.aculab.com> <20180326165425.GA15554@ziepe.ca> <20180326202545.GB15554@ziepe.ca> <20180326210951.GD15554@ziepe.ca> <1522101717.7364.14.camel@kernel.crashing.org> <20180326222756.GJ15554@ziepe.ca> <1522103771.7364.20.camel@kernel.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1522103771.7364.20.camel@kernel.crashing.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" To: Jason Gunthorpe Cc: "Paul E. McKenney" , Arnd Bergmann , "linux-rdma@vger.kernel.org" , Will Deacon , Sinan Kaya , David Laight , Oliver , Alexander Duyck , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" List-Id: linux-rdma@vger.kernel.org On Tue, 2018-03-27 at 09:36 +1100, Benjamin Herrenschmidt wrote: > I don't kow, it used to be the case, at least that's what drove us to > define things the way we did. > > Maybe things changed, but if that's the case, nobody knows for sure, > and we probably want to get Linus POV on the matter. > > I know I still write drivers that do not add a wmb in that case because > I expect things to work without it. > > If that has changed, we probably can relax some of the barriers in our > implementations of writel on a number of architectures, but not before > auditing a bunch more drivers to make sure they have the write wmb()'s Note also that this was the entire point behind the definition of the _relaxed() accessors, to lift that specific ordering guarantee. If you now says that memory + writel requires a wmb() in between then you made writel be identical to writel_relaxed. You might notice that Documentation/driver-api/device-io.rst makes no mention of wmb() at all. Cheers, Ben.