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 409m7K0BcTzF2F6 for ; Wed, 28 Mar 2018 09:35:40 +1100 (AEDT) Subject: Re: RFC on writel and writel_relaxed To: Alexander Duyck , Benjamin Herrenschmidt Cc: Arnd Bergmann , Jason Gunthorpe , David Laight , Oliver , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , "linux-rdma@vger.kernel.org" , Will Deacon , "Paul E. McKenney" , "netdev@vger.kernel.org" References: From: Sinan Kaya Message-ID: Date: Tue, 27 Mar 2018 18:35:34 -0400 MIME-Version: 1.0 In-Reply-To: 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/27/2018 5:54 PM, Alexander Duyck wrote: > I view the wmb() + writel_relaxed() as more of a driver owning and > handling this itself. Besides in the Intel Ethernet driver case it is > better performance as our wmb() placement for us also provides a > secondary barrier so we don't need to add a separate smp_wmb() to deal > with a potential race we have with the Tx cleanup. Thanks for the reminder. I forgot about the double barrier optimization. wmb() + writel_relaxed() seems to be the best option for Intel network drivers at this moment. Otherwise, we'll have to remove wmb() and throw in smp barriers there like you mentioned. I'll leave the changes in the Intel drivers alone. -- 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.