From: Niklas Cassel <niklas.cassel@axis.com>
To: David Miller <davem@davemloft.net>
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
Date: Mon, 12 Mar 2018 09:55:42 +0100 [thread overview]
Message-ID: <20180312085541.GA406@axis.com> (raw)
In-Reply-To: <20180309.101520.1551234308448290917.davem@davemloft.net>
On Fri, Mar 09, 2018 at 10:15:20AM -0500, David Miller wrote:
> From: Jose Abreu <Jose.Abreu@synopsys.com>
> Date: Fri, 9 Mar 2018 10:26:11 +0000
>
> > Sorry but I know at least two architectures which don't do a
> > wmb() upon an writel [1] [2]. This can be critical if if we are
> > accessing the device through some slow or filled bus which will
> > delay accesses to the device IO. Notice that writel and then
> > readl to the same address will force CPU to wait for writel
> > completion before readl, but in this case we are using DMA and
> > then writel so I think a wmb() before the writel is a safe measure.
>
> Wait a second.
>
> This is not about whether there is an explicit memory barrier
> instruction placed in the writel() implementation.
>
> Are you saying that the cpu(s) in question will reorder stores in
> their store buffers, even if they are to real memory vs. IOMEM?
>
> That's really dangerous.
Hello David,
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.
Best regards,
Niklas
next prev parent reply other threads:[~2018-03-12 8:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-08 10:30 [PATCH net-next] net: stmmac: remove superfluous wmb() memory barriers Niklas Cassel
2018-03-09 2:50 ` David Miller
2018-03-09 10:26 ` Jose Abreu
2018-03-09 10:48 ` Pavel Machek
2018-03-09 15:15 ` David Miller
2018-03-12 8:55 ` Niklas Cassel [this message]
2018-03-13 1:20 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180312085541.GA406@axis.com \
--to=niklas.cassel@axis.com \
--cc=Jose.Abreu@synopsys.com \
--cc=alexandre.torgue@st.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=peppe.cavallaro@st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).