Received: by 10.213.65.68 with SMTP id h4csp73341imn; Mon, 12 Mar 2018 18:21:25 -0700 (PDT) X-Google-Smtp-Source: AG47ELsPJzDnQhnLxsoEiWLK6kxa7LN63laIdUg2hT8jgo3pxw5UJ1REOzPpnZSOsOBMaahHpEHm X-Received: by 10.101.77.69 with SMTP id j5mr8292152pgt.352.1520904085677; Mon, 12 Mar 2018 18:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520904085; cv=none; d=google.com; s=arc-20160816; b=vuTwYwQfERbkwQentOV9uYrMBw4t+5UEdBionDhv0LTwE6B9TXxP5dgh7Wt85pSpGf 113dMLqfwx5rZ/0Isg0uCaIPWFNXtBT7FBFzx0NgN8qvNVG29n9bVK6swV4oBacU4TKw jov97LaN9wlgHwKZ8mseBX+fgKUhmySdzcx1len5IWoVOaWJSMKcyYVZF6E3lnH8iHDv tymj7/TXXI/iIPm/I5TNmsXwCXHjsv151qEiaSiZl/RvHng4tY8KcVFVHGgBTfrnC6vS DdmkAEtHd8pfeA8QGUWpXMn3YTt1yoZW2nLlFu8xcBCCKipeyVsrH0+QqIdYXmn0eMgr lPaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=M5SGpiRp9BuLLGx6k+46llE9DnYotfj0g+GbDlNQD1o=; b=Fxxpn6do20Ag4MJ/D0TgZgFXRvvySrG6vCJRqd2fCeEgXs7HtmsJxD5xwBkEtGtFN5 OwluemRncvj6kGkMi3OvJQg85jOGLpX+S6bYVrE1sZR1ynbTdn5lmx1ysvRvkUwReWTU Q6TjHRuQ7IXlW/JVc3FRtTa0hEhzMdLFicGTKRWd2BvQTPPloSNzAo1Z3sKIjUO4atnD pPce8Ybq27EwIyHIVW1mfWxuba+g5D143kahPdrkiFxMmbdWOCjOn8qm//Ea6TzNeg8z dSfcrLZy8inhEiVk65j25nINDFXEZ5sF+9rG4E+VW2xyvoznpzDwh30OTkxDgEjLytjP Spsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17-v6si6956311plp.561.2018.03.12.18.21.11; Mon, 12 Mar 2018 18:21:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932408AbeCMBUO (ORCPT + 99 others); Mon, 12 Mar 2018 21:20:14 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:39278 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932211AbeCMBUM (ORCPT ); Mon, 12 Mar 2018 21:20:12 -0400 Received: from localhost (pool-173-77-163-229.nycmny.fios.verizon.net [173.77.163.229]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id D19E410180CCB; Mon, 12 Mar 2018 18:20:11 -0700 (PDT) Date: Mon, 12 Mar 2018 21:20:10 -0400 (EDT) Message-Id: <20180312.212010.215262612578386966.davem@davemloft.net> To: niklas.cassel@axis.com Cc: Jose.Abreu@synopsys.com, peppe.cavallaro@st.com, alexandre.torgue@st.com, pavel@ucw.cz, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net: stmmac: remove superfluous wmb() memory barriers From: David Miller In-Reply-To: <20180312085541.GA406@axis.com> References: <20180309.101520.1551234308448290917.davem@davemloft.net> <20180312085541.GA406@axis.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Mon, 12 Mar 2018 18:20:12 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Niklas Cassel Date: Mon, 12 Mar 2018 09:55:42 +0100 > Jose is simply responding to the commit message description of this patch. > > You explained that there is an implicit memory barrier between physical memory > writes and those to MMIO register space, as long as you used writel(). > > I assumed that you meant writel() vs writel_relaxed(), where there latter > does not do an implicit barrier. > > I also found this from you: > https://lwn.net/Articles/198995/ > > If my assumption was incorrect, please correct me. > > As you seem to possess knowledge regarding this, you are probably the most > suited person to know if this patch simply needs a commit message rewrite, > or if it should be dropped completely. Yes, I have always argued that the non-relaxed {read,write}{b,w,l}() interfaces should imply barriers wrt. physical memory accesses. Without that, drivers are harder to write. Specifically, drivers that work properly on all architectures will be very hard to write. But looking at some drivers, probably this isn't fully the case right now. Which is unfortunate, but we must code to reality. For example, looking at drivers/net/ethernet/broadcom/tg3.c, we have tg3_start_xmit() going: write descriptors ... /* Sync BD data before updating mailbox */ wmb(); ... /* Packets are ready, update Tx producer idx on card. */ tw32_tx_mbox(tnapi->prodmbox, entry); so it really seems to be necessary. So this stmmac revert is not valid. Sorry for all the confusion. I guess it's a lot of wishful thinking on my part :-)