From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH net-next] net: stmmac: remove superfluous wmb() memory barriers Date: Fri, 9 Mar 2018 11:48:56 +0100 Message-ID: <20180309104855.GA17998@amd> References: <20180308103006.1197-1-niklas.cassel@axis.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8t9RHnE3ZwKMSgU+" Cc: Niklas Cassel , Giuseppe Cavallaro , Alexandre Torgue , Niklas Cassel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Jose Abreu Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org --8t9RHnE3ZwKMSgU+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri 2018-03-09 10:26:11, Jose Abreu wrote: > Hi Niklas, >=20 > On 08-03-2018 10:30, Niklas Cassel wrote: > > These wmb() memory barriers are performed after the last descriptor wri= te, > > and they are followed by enable_dma_transmission()/set_tx_tail_ptr(), > > i.e. a writel() to MMIO register space. > > Since writel() itself performs the equivalent of a wmb()=20 >=20 > 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. This also matches documentation, as I tried to point out. --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --8t9RHnE3ZwKMSgU+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlqiZpcACgkQMOfwapXb+vIxVQCgvqVPkPgewr9bMlyEKq+HBOSM FLAAoLfY63FHLQ/olztxWfoq/wM9oCiC =frPy -----END PGP SIGNATURE----- --8t9RHnE3ZwKMSgU+--