From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Date: Wed, 28 Mar 2018 18:03:16 +0000 Subject: Re: [PATCH] docs/memory-barriers.txt: Fix broken DMA vs MMIO ordering example Message-Id: <20180328180316.GN4082@hirez.programming.kicks-ass.net> List-Id: References: <1522156287-15169-1-git-send-email-will.deacon@arm.com> <20180327150252.GN3675@linux.vnet.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tony Luck Cc: Sinan Kaya , Paul McKenney , Will Deacon , "linux-kernel@vger.kernel.org" , linux-doc@vger.kernel.org, Benjamin Herrenschmidt , Arnd Bergmann , Jason Gunthorpe , Ingo Molnar , Jonathan Corbet , "linux-ia64@vger.kernel.org" On Wed, Mar 28, 2018 at 10:57:11AM -0700, Tony Luck wrote: > On Wed, Mar 28, 2018 at 6:02 AM, Sinan Kaya wrote: > > +linux-ia64 > > Does IA64 follow this requirement? If not, is implementation planned? > > > > "no wmb() before writel()" > > > > Linus asked us to get rid of wmb() in front of writel() for UC memory. > > Just checking that we are not breaking anything for IA64. > > We should be OK on ia64, writel() uses a cast to: > > *(volatile unsigned int __force *) > > which the compiler takes as a request to use a "st4.rel" instruction > (meaning "store with release semantics"). So the value stored will > be visible to anything that follows. Just to nitpick, regular release semantics don't guarantee anything like that, but ia64 never actually got around to implementing proper release and it's a full barrier and thus what you say is true.