From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40B5Yt6KdHzF1vJ for ; Wed, 28 Mar 2018 22:41:20 +1100 (AEDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Date: Wed, 28 Mar 2018 07:41:16 -0400 From: okaya@codeaurora.org To: Linus Torvalds Cc: Benjamin Herrenschmidt , Alexander Duyck , Will Deacon , Arnd Bergmann , Jason Gunthorpe , David Laight , Oliver , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , linux-rdma@vger.kernel.org, Alexander Duyck , "Paul E. McKenney" , netdev@vger.kernel.org, linus971@gmail.com Subject: Re: RFC on writel and writel_relaxed In-Reply-To: References: <1521854626.16434.359.camel@kernel.crashing.org> <58ce5b83f40f4775bec1be8db66adb0d@AcuMS.aculab.com> <20180326165425.GA15554@ziepe.ca> <20180326202545.GB15554@ziepe.ca> <20180326210951.GD15554@ziepe.ca> <1522101616.7364.13.camel@kernel.crashing.org> <1e077f6a-90b6-cce9-6f0f-a8c003fec850@codeaurora.org> <20180327151029.GB17494@arm.com> <1522186396.7364.61.camel@kernel.crashing.org> <1522198981.7364.81.camel@kernel.crashing.org> Message-ID: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 2018-03-28 02:14, Linus Torvalds wrote: > On Tue, Mar 27, 2018 at 5:24 PM, Sinan Kaya > wrote: >> >> Basically changing it to >> >> dma_buffer->foo = 1; /* WB */ >> wmb() >> writel_relaxed(KICK, DMA_KICK_REGISTER); /* UC */ >> mmiowb() > > Why? > > Why not just remove the wmb(), and keep the barrier in the writel()? Yes, we want to get there indeed. It is because of some arch not implementing writel properly. Maintainers want to play safe. That is why I asked if IA64 and other well known archs follow the strongly ordered rule at this moment like PPC and ARM. Or should we go and inform every arch about this before yanking wmb()? Maintainers are afraid of introducing a regression. > > The above code makes no sense, and just looks stupid to me. It also > generates pointlessly bad code on x86, so it's bad there too. > > Linus