Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hayashi.kunihiko@socionext.com (Kunihiko Hayashi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next v6 2/2] net: ethernet: socionext: add AVE ethernet driver
Date: Mon, 18 Dec 2017 12:51:06 +0900	[thread overview]
Message-ID: <20171218125105.962D.4A936039@socionext.com> (raw)
In-Reply-To: <20171215.125749.1752831437819486183.davem@davemloft.net>

Hello David,

On Fri, 15 Dec 2017 12:57:49 -0500 David Miller <davem@davemloft.net> wrote:

> From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> Date: Thu, 14 Dec 2017 19:05:10 +0900
> 
> > +static void ave_desc_write(struct net_device *ndev, enum desc_id id,
> > +			   int entry, int offset, u32 val)
> > +{
> > +	struct ave_private *priv = netdev_priv(ndev);
> > +	u32 addr = (id == AVE_DESCID_TX) ? priv->tx.daddr : priv->rx.daddr;
> 
> Please always order local variables from longest to shortest line.
> 
> Audit your entire submission for this issue, thank you.

I see. I'll fix the order of local variables.

> > +	ret = register_netdev(ndev);
> > +	if (ret) {
> > +		dev_err(dev, "failed to register netdevice\n");
> > +		goto out_del_napi;
> > +	}
> > +
> > +	platform_set_drvdata(pdev, ndev);
> 
> You must make all software state settings before reigster_netdev() is
> invoked.
> 
> At the exact moment you call register_netdev(), your device can be
> brought up, interrupts processed, PHY state changes made, etc.
> 
> So you must put this platform_set_drvdata() before the
> register_netdev() call.
> 
> Generally speaking, register_netdev() must always be the last state
> modification done by your probe routine.

Indeed. It's not good to invoke register_netdev() with all software
initialization not completed. I'll move register_netdev() after
all initialization.

Thank you,

---
Best Regards,
Kunihiko Hayashi

      reply	other threads:[~2017-12-18  3:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 10:05 [PATCH net-next v6 0/2] add UniPhier AVE ethernet support Kunihiko Hayashi
2017-12-14 10:05 ` [PATCH net-next v6 1/2] dt-bindings: net: add DT bindings for Socionext UniPhier AVE Kunihiko Hayashi
2017-12-14 23:24   ` Florian Fainelli
2017-12-15  8:03     ` Kunihiko Hayashi
2017-12-14 10:05 ` [PATCH net-next v6 2/2] net: ethernet: socionext: add AVE ethernet driver Kunihiko Hayashi
2017-12-15 17:57   ` David Miller
2017-12-18  3:51     ` Kunihiko Hayashi [this message]

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=20171218125105.962D.4A936039@socionext.com \
    --to=hayashi.kunihiko@socionext.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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