From: Florian Fainelli <f.fainelli@gmail.com>
To: Tim Harvey <tharvey@gateworks.com>, netdev <netdev@vger.kernel.org>
Subject: Re: Linux network PHY initial configuration for ports not 'up'
Date: Mon, 7 Oct 2024 10:28:43 -0700 [thread overview]
Message-ID: <c572529e-78c4-42d5-a799-1027fd5fca29@gmail.com> (raw)
In-Reply-To: <CAJ+vNU12DeT3QWp8aU+tSL-PF00yJu5M36Bmx_tw_3oXsyb76g@mail.gmail.com>
On 10/7/24 09:48, Tim Harvey wrote:
> Greetings,
>
> What is the policy for configuration of network PHY's for ports that
> are not brought 'up'?
>
> I work with boards with several PHY's that have invalid link
> configuration which does not get fixed until the port is brought up.
> One could argue that this is fine because the port isn't up but in the
> case of LED misconfiguration people wonder why the LED's are not
> configured properly until the port is brought up (or they wonder why
> LEDs are ilumnated at all for a port that isn't up). Another example
> would be a PHY with EEE errata where EEE should be disabled but this
> doesn't happen utnil the port is brought up yet while the port is
> 'down' a link with EEE is still established at the PHY level with a
> link partner. One could also point out that power is being used to
> link PHY's that should not even be linked.
>
> In other words, should a MAC driver somehow trigger a PHY to get
> initialized (as in fixups and allowing a physical link) even if the
> MAC port is not up? If so, how is this done currently?
There are drivers that have historically brought up Ethernet PHYs in the
MAC's probe routine. This is fine in premise, and you get a bit of speed
up because by the time the network interface is opened by user-space you
have usually finished auto-negotiation. This does mean that usually the
PHY is already in the UP state.
The caveat with that approach is that it does not conserve power, and it
assumes that the network device will end-up being used shortly
thereafter, which is not a given.
For LEDs, I would argue that if you care about having some sensible
feedback, the place where this belongs is the boot loader, because you
can address any kernel short comings there: lack of a kernel driver for
said PHY/MAC, network never being brought up, etc.
For errata like EEE, it seems fine to address that at link up time.
--
Florian
next prev parent reply other threads:[~2024-10-07 17:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 16:48 Linux network PHY initial configuration for ports not 'up' Tim Harvey
2024-10-07 17:28 ` Florian Fainelli [this message]
2024-10-07 18:18 ` Tim Harvey
2024-10-07 18:35 ` Florian Fainelli
2024-10-08 20:35 ` Tim Harvey
2024-10-09 0:30 ` Andrew Lunn
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=c572529e-78c4-42d5-a799-1027fd5fca29@gmail.com \
--to=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=tharvey@gateworks.com \
/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).