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 407kJx28mdzF1jh for ; Sun, 25 Mar 2018 02:06:57 +1100 (AEDT) Subject: Re: RFC on writel and writel_relaxed To: Benjamin Herrenschmidt , Oliver Cc: linuxppc dev list , "linux-rdma@vger.kernel.org" , Marc Zyngier , Will Deacon References: <3611eabe-2999-1482-b2b4-6d216bbe4762@codeaurora.org> <4e5c745a-8b9b-959e-8893-d99cd6032484@codeaurora.org> <1521692689.16434.293.camel@kernel.crashing.org> <1521726722.16434.312.camel@kernel.crashing.org> <5ccdb208-4664-0a7f-df5d-2e12cbe4c239@codeaurora.org> <1521764168.16434.324.camel@kernel.crashing.org> <9c7d3d35-ddaf-60ee-1430-19b5c3f66813@codeaurora.org> <1521854570.16434.358.camel@kernel.crashing.org> From: Sinan Kaya Message-ID: <511b73e6-797c-9986-075c-c5b5d4eb1ed2@codeaurora.org> Date: Sat, 24 Mar 2018 11:06:52 -0400 MIME-Version: 1.0 In-Reply-To: <1521854570.16434.358.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 3/23/2018 9:22 PM, Benjamin Herrenschmidt wrote: >> Yes, I'm %100 sure. The answer is both writel() and barrier() generates >> a write barrier instruction. I found this by searching the kernel disassembly >> for back to back "dsb st" instruction. > I'm not sure you are correct here. As I wrote below, the implementatoin > of writel() contains an *explicit" memory barrier which is completely > different to a barrier() instruction: OK. I did some directed tests and I'm taking it back. barrier() is a compiler reordering statement only. What got me confused was this sequence: wmb() barrier() writel() I thought that the second barrier instruction was coming from barrier() but it was actually coming from writel(). -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.