From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4098LJ27wzzF27S for ; Tue, 27 Mar 2018 09:43:03 +1100 (AEDT) Message-ID: <1522104151.7364.23.camel@kernel.crashing.org> Subject: Re: RFC on writel and writel_relaxed From: Benjamin Herrenschmidt To: Jason Gunthorpe Cc: Sinan Kaya , Arnd Bergmann , David Laight , Oliver , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , "linux-rdma@vger.kernel.org" , Alexander Duyck , Will Deacon , "Paul E. McKenney" Date: Tue, 27 Mar 2018 09:42:31 +1100 In-Reply-To: <1522103771.7364.20.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> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.