From: Florian Fainelli <f.fainelli@gmail.com>
To: Stefan Agner <stefan@agner.ch>,
systemd-devel@lists.freedesktop.org, netdev@vger.kernel.org,
davem@davemloft.net
Cc: fabio.estevam@freescale.com, l.stach@pengutronix.de,
u.kleine-koenig@pengutronix.de, bryan.wu@canonical.com,
bob.ham@collabora.com, Andrew Lunn <andrew@lunn.ch>
Subject: Re: Configuring ethernet link fails with No such device
Date: Mon, 11 Apr 2016 16:10:53 -0700 [thread overview]
Message-ID: <570C2EFD.6070602@gmail.com> (raw)
In-Reply-To: <67b662523c63277fa95a59472cbf018f@agner.ch>
On 11/04/16 15:46, Stefan Agner wrote:
> Hi All,
>
> I traced an issue in which we tried configuring duplex mode and speed in
> a systemd-udevd .link file failed with the following error:
> "Could not set speed or duplex of eth0 to 0 Mbps (half): No such device"
>
> The FEC driver (fec_main.c) does not initialize phy_dev until the device
> has been opened, and therefor the callback fec_enet_(get|set)_settings
> returns -19.
>
> What is the expectation/definition when link configuration should be
> possible? Only after the network device got opened or before?
It seems to me like systemd tries to configure the device while we are
still opening it, which is arguably something that can be done, but you
are in a transient state, the interface is not completely ready yet.
>
> Or in other words: Is this a Kernel or systemd issue? At what point is
> link configuration "guaranteed" to work?
Past ndo_open() had a chance to return, therefore connect to the PHY
device, is when the configuration/information querying is able to succeed.
>
> It seems that the FEC driver used to probe the PHY earlier, it has been
> moved to the open callback with commit 418bd0d4df ("netdev/fec: fix
> ifconfig eth0 down hang issue")...
Part of the reason for doing that, is that probing for the PHY during
the driver's probe function could leave you with unused HW that is
powered on for no good reason. Until we get into ndo_open, we have no
clue if the interface is going to be used or not, so it is better to
move part of the HW initialization as late as possible in the process.
>
> There has been a similar report on the systemd-devel mailing list a
> while ago, probably the same underlying issue:
> https://www.mail-archive.com/systemd-devel@lists.freedesktop.org/msg33186.html
>
> --
> Stefan
>
--
Florian
next prev parent reply other threads:[~2016-04-11 23:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-11 22:46 Configuring ethernet link fails with No such device Stefan Agner
2016-04-11 23:10 ` Florian Fainelli [this message]
2016-04-12 1:29 ` David Miller
2016-04-12 7:25 ` Stefan Agner
2016-04-12 8:58 ` Bob Ham
2016-04-12 15:44 ` David Miller
2016-04-13 1:29 ` Stefan Agner
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=570C2EFD.6070602@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=bob.ham@collabora.com \
--cc=bryan.wu@canonical.com \
--cc=davem@davemloft.net \
--cc=fabio.estevam@freescale.com \
--cc=l.stach@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=stefan@agner.ch \
--cc=systemd-devel@lists.freedesktop.org \
--cc=u.kleine-koenig@pengutronix.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).