linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Duan <fugang.duan@nxp.com>
To: David Miller <davem@davemloft.net>,
	"s.riedmueller@phytec.de" <s.riedmueller@phytec.de>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"c.hemp@phytec.de" <C.Hemp@phytec.de>
Subject: RE: [EXT] Re: [PATCH] net: fec: Keep device numbering consistent with datasheet
Date: Thu, 24 Sep 2020 06:36:23 +0000	[thread overview]
Message-ID: <AM8PR04MB73153F8A9E3A4DB0F7AA8003FF390@AM8PR04MB7315.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200923.133147.842604978902817779.davem@davemloft.net>

From: David Miller <davem@davemloft.net> Sent: Thursday, September 24, 2020 4:32 AM
> From: Stefan Riedmueller <s.riedmueller@phytec.de>
> Date: Wed, 23 Sep 2020 16:25:28 +0200
> 
> > From: Christian Hemp <c.hemp@phytec.de>
> >
> > Make use of device tree alias for device enumeration to keep the
> > device order consistent with the naming in the datasheet.
> >
> > Otherwise for the i.MX 6UL/ULL the ENET1 interface is enumerated as
> > eth1 and ENET2 as eth0.
> >
> > Signed-off-by: Christian Hemp <c.hemp@phytec.de>
> > Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> 
> Device naming and ordering for networking devices was never, ever,
> guaranteed.
> 
> Use udev or similar.
> 
> > @@ -3691,6 +3692,10 @@ fec_probe(struct platform_device *pdev)
> >
> >       ndev->max_mtu = PKT_MAXBUF_SIZE - ETH_HLEN - ETH_FCS_LEN;
> >
> > +     eth_id = of_alias_get_id(pdev->dev.of_node, "ethernet");
> > +     if (eth_id >= 0)
> > +             sprintf(ndev->name, "eth%d", eth_id);
> 
> You can't ever just write into ndev->name, what if another networking device is
> already using that name?
> 
> This change is incorrect on many levels.

David is correct.

For example, imx8DXL has ethernet0 is EQOS TSN, ethernet1 is FEC.
EQOS TSN is andother driver and is registered early, the dev->name is eth0.
So the patch will bring conflict in such case.

Andy

  reply	other threads:[~2020-09-24  6:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23 14:25 [PATCH] net: fec: Keep device numbering consistent with datasheet Stefan Riedmueller
2020-09-23 19:17 ` Andrew Lunn
2020-09-23 20:31 ` David Miller
2020-09-24  6:36   ` Andy Duan [this message]
2020-09-24  7:11     ` [EXT] " Stefan Riedmüller

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=AM8PR04MB73153F8A9E3A4DB0F7AA8003FF390@AM8PR04MB7315.eurprd04.prod.outlook.com \
    --to=fugang.duan@nxp.com \
    --cc=C.Hemp@phytec.de \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=s.riedmueller@phytec.de \
    /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).