All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: David Miller <davem@davemloft.net>
Cc: niklas.cassel@axis.com, peppe.cavallaro@st.com,
	alexandre.torgue@st.com, Jose.Abreu@synopsys.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/4] net: stmmac: use correct barrier between coherent memory and MMIO
Date: Thu, 8 Mar 2018 10:05:35 +0100	[thread overview]
Message-ID: <20180308090535.GD17761@amd> (raw)
In-Reply-To: <20180307.124249.619165601144161535.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

On Wed 2018-03-07 12:42:49, David Miller wrote:
> From: Niklas Cassel <niklas.cassel@axis.com>
> Date: Wed, 7 Mar 2018 18:21:57 +0100
> 
> > Considering this, you can drop/revert:
> > 95eb930a40a0 ("net: stmmac: use correct barrier between coherent memory and MMIO")
> > or perhaps you want me to send a revert?
> 
> You must submit explicit patches to do a revert or any other change.
> 
> > After reverting 95eb930a40a0, we will still have a dma_wmb() _after_ the
> > last descriptor word write. You just explained that nothing else is needed
> > after the last descriptor word write, so I actually think that this last
> > barrier is superfluous.
> 
> You don't need one after the last descriptor write.
> 
> Look, you're only concerned with ordering within the descriptor writes.
> 
> So it's only about:
> 
> 	desc->a = x;
> 
> 	/* Write to 'a' must be visible to the hardware before 'b'. */
> 	dma_wmb();
> 	desc->b = y;
> 
> 	writel();
> 
> That's all that you need.

We may need to fix the docs then, there's wmb() there in the docs:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/memory-barriers.txt?h=v4.16-rc1#n1913

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  parent reply	other threads:[~2018-03-08  9:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 21:47 [PATCH net-next 0/4] stmmac barrier fixes and cleanup Niklas Cassel
2018-02-26 21:47 ` [PATCH net-next 1/4] net: stmmac: ensure that the MSS desc is the last desc to set the own bit Niklas Cassel
2018-02-26 21:47 ` [PATCH net-next 2/4] net: stmmac: use correct barrier between coherent memory and MMIO Niklas Cassel
2018-03-02  9:20   ` Pavel Machek
2018-03-02 14:54     ` David Miller
2018-03-02 23:28       ` Niklas Cassel
2018-03-07 15:32         ` David Miller
2018-03-07 17:21           ` Niklas Cassel
2018-03-07 17:42             ` David Miller
2018-03-07 18:09               ` Niklas Cassel
2018-03-08  9:05               ` Pavel Machek [this message]
2018-02-26 21:47 ` [PATCH net-next 3/4] net: stmmac: ensure that the device has released ownership before reading data Niklas Cassel
2018-02-26 21:47 ` [PATCH net-next 4/4] net: stmmac: make dwmac4_release_tx_desc() clear all descriptor fields Niklas Cassel
2018-02-27 19:28 ` [PATCH net-next 0/4] stmmac barrier fixes and cleanup 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=20180308090535.GD17761@amd \
    --to=pavel@ucw.cz \
    --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=niklas.cassel@axis.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.