From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Subject: Re: [PATCH v5] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Date: Tue, 10 Nov 2015 23:07:24 +0000 Message-ID: References: <1447172063-27234-1-git-send-email-mans@mansr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "linux-kernel\@vger.kernel.org" , netdev , slash.tmp@free.fr To: Andy Shevchenko Return-path: In-Reply-To: (Andy Shevchenko's message of "Wed, 11 Nov 2015 00:40:53 +0200") Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Andy Shevchenko writes: > On Wed, Nov 11, 2015 at 12:34 AM, M=C3=A5ns Rullg=C3=A5rd wrote: >> Andy Shevchenko writes: >> >>>> +static inline void nb8800_maskb(struct nb8800_priv *priv, int reg= , >>>> + u32 mask, u32 val) >>>> +{ >>>> + u32 old =3D nb8800_readb(priv, reg); >>>> + u32 new =3D (old & ~mask) | val; >>> >>> Shoudn't be "=E2=80=A6 | (val & mask);" ? >> >> No, it's meant to replace the bits in mask with the corresponding bi= ts >> from val. > > But you unconditionally use entire val value which might bring bits > outside of mask. Very well, I'll apply the mask to both then. >>>> + nb8800_writel(priv, NB8800_TX_DESC_ADDR, txb->dma_desc); >>>> + wmb(); /* ensure desc addr is written before star= ting DMA */ >>> >>> Hm=E2=80=A6 Have I missed corresponding rmb() ? If it's about MMIO,= perhaps mmiowb() ? >> >> Possibly. > > Standalone wmb() doesn't make sense. It does if you need to enforce ordering between normal and I/O memory. In fact, since the descriptor is filled in using normal memory accesses= , my understanding is that mmiowb() would be insufficient here. The comment could be improved, however. --=20 M=C3=A5ns Rullg=C3=A5rd mans@mansr.com