From: Kunihiko Hayashi <hayashi.kunihiko-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
andrew-g2DYL2Zd6BY@public.gmane.org,
f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org,
masami.hiramatsu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [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-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Hello David,
On Fri, 15 Dec 2017 12:57:49 -0500 David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
> From: Kunihiko Hayashi <hayashi.kunihiko-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
> 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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent 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
[not found] ` <1513245910-15961-2-git-send-email-hayashi.kunihiko-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
2017-12-14 23:24 ` Florian Fainelli
[not found] ` <7749e13a-56ef-0d43-1a41-dbd457227575-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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
[not found] ` <1513245910-15961-3-git-send-email-hayashi.kunihiko-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
2017-12-15 17:57 ` David Miller
[not found] ` <20171215.125749.1752831437819486183.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
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-uwylwvc0a2jby3ivrkzq2a@public.gmane.org \
--cc=andrew-g2DYL2Zd6BY@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=masami.hiramatsu-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).