All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>,
	slash.tmp@free.fr
Subject: Re: [PATCH v5] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller
Date: Tue, 10 Nov 2015 22:34:53 +0000	[thread overview]
Message-ID: <yw1xr3jxpjoy.fsf@unicorn.mansr.com> (raw)
In-Reply-To: <CAHp75Vch3vJEqYsCRUoctEmF0EoFx+0y7ZO+LjmdpQKAoikiOA@mail.gmail.com> (Andy Shevchenko's message of "Wed, 11 Nov 2015 00:09:23 +0200")

Andy Shevchenko <andy.shevchenko@gmail.com> writes:

>> +static inline void nb8800_maskb(struct nb8800_priv *priv, int reg,
>> +                               u32 mask, u32 val)
>> +{
>> +       u32 old = nb8800_readb(priv, reg);
>> +       u32 new = (old & ~mask) | val;
>
> Shoudn't be "… | (val & mask);" ?

No, it's meant to replace the bits in mask with the corresponding bits
from val.

> + empty line?
>
>> +       if (new != old)
>> +               nb8800_writeb(priv, reg, new);
>> +}
>> +

[...]

>> +static void nb8800_receive(struct net_device *dev, int i, int len)
>
> unsigned int i ?
> len as well?

Does it matter?  The values are nowhere near overflowing signed int.


[...]

>> +               /* If a packet arrived after we last checked but
>> +                * before writing RX_ITR, the interrupt will be
>> +                * delayed, so we retrieve it now. */
>
> Block comments usually
> /*
>  * text
>  */

Documentation/CodingStyle says net/ and drivers/net/ are special, though
currently a mix of styles can be found.  Personally, I don't
particularly care.

> Can be longer lines?

Still won't fit on two lines.

>> +               if (priv->rx_descs[next].report)
>> +                       goto again;
>> +
>> +               napi_complete_done(napi, work);
>> +       }
>> +
>> +       return work;
>> +}
>> +
>> +static void nb8800_tx_dma_start(struct net_device *dev)
>> +{
>> +       struct nb8800_priv *priv = netdev_priv(dev);
>> +       struct nb8800_tx_buf *txb;
>> +       u32 txc_cr;
>> +
>> +       txb = &priv->tx_bufs[priv->tx_queue];
>> +       if (!txb->ready)
>> +               return;
>> +
>> +       txc_cr = nb8800_readl(priv, NB8800_TXC_CR);
>> +       if (txc_cr & TCR_EN)
>> +               return;
>> +
>> +       nb8800_writel(priv, NB8800_TX_DESC_ADDR, txb->dma_desc);
>> +       wmb();          /* ensure desc addr is written before starting DMA */
>
> Hm… Have I missed corresponding rmb() ? If it's about MMIO, perhaps mmiowb() ?

Possibly.

>> +       nb8800_writel(priv, NB8800_TXC_CR, txc_cr | TCR_EN);
>> +
>> +       priv->tx_queue = (priv->tx_queue + txb->chain_len) % TX_DESC_COUNT;
>> +}

-- 
Måns Rullgård
mans@mansr.com

  reply	other threads:[~2015-11-10 22:35 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 16:14 [PATCH v5] net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller Mans Rullgard
2015-11-10 17:55 ` Eric Dumazet
2015-11-10 18:05   ` Måns Rullgård
2015-11-10 20:04     ` David Miller
2015-11-10 20:53       ` Måns Rullgård
2015-11-10 21:06         ` David Miller
2015-11-10 21:21           ` Måns Rullgård
2015-11-10 21:51             ` Eric Dumazet
2015-11-11 13:41               ` Mason
2015-11-11 13:54                 ` Måns Rullgård
2015-11-11 14:10                   ` Eric Dumazet
2015-11-11 14:06                 ` Eric Dumazet
2015-11-10 17:58 ` Eric Dumazet
2015-11-10 18:07   ` Måns Rullgård
2015-11-10 19:13 ` Mason
2015-11-10 19:25   ` Måns Rullgård
2015-11-12 13:33     ` Mason
2015-11-12 14:04       ` Måns Rullgård
2015-11-12 16:19         ` Mason
2015-11-12 16:57           ` Måns Rullgård
2015-11-12 17:20             ` Måns Rullgård
2015-11-10 22:09 ` Andy Shevchenko
2015-11-10 22:34   ` Måns Rullgård [this message]
2015-11-10 22:40     ` Andy Shevchenko
2015-11-10 23:07       ` Måns Rullgård
2015-11-11  0:36         ` Andy Shevchenko
2015-11-11  0:44           ` Måns Rullgård
2015-11-10 23:34 ` Francois Romieu
2015-11-11  0:40   ` Måns Rullgård
2015-11-11  2:11     ` David Miller
2015-11-11 12:22       ` Måns Rullgård
2015-11-11 13:04         ` Måns Rullgård
2015-11-11 13:29           ` Eric Dumazet
2015-11-11 13:48             ` Måns Rullgård
2015-11-11 14:09               ` Eric Dumazet
2015-11-11 14:15                 ` Måns Rullgård
2015-11-11 14:35                   ` Måns Rullgård
2015-11-11 14:44                     ` Eric Dumazet
2015-11-11 14:42                   ` Eric Dumazet
2015-11-11 16:24           ` David Miller
2015-11-11 18:25             ` Måns Rullgård
2015-11-11 19:02               ` David Miller
2015-11-11 19:09                 ` Måns Rullgård
2015-11-11 19:13                   ` David Miller
2015-11-11 19:17                     ` Måns Rullgård
2015-11-11 19:19                       ` David Miller
2015-11-11 19:25                         ` Måns Rullgård
2015-11-11 19:26                           ` David Miller
2015-11-11 19:35                             ` Måns Rullgård
2015-11-11 19:48                               ` David Miller
2015-11-11 20:47                                 ` Måns Rullgård
2015-11-11 16: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=yw1xr3jxpjoy.fsf@unicorn.mansr.com \
    --to=mans@mansr.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=slash.tmp@free.fr \
    /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.