From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: wens@csie.org, Andrew Lunn <andrew@lunn.ch>,
netdev@vger.kernel.org, linux-sunxi@lists.linux.dev,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Furong Xu <0x1207@gmail.com>,
Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] net: stmmac: allow drivers to explicitly select PHY device
Date: Wed, 28 May 2025 19:34:44 +0100 [thread overview]
Message-ID: <aDdXRPD2NpiZMsfZ@shell.armlinux.org.uk> (raw)
In-Reply-To: <CADvTj4qyRRCSnvvYHLvTq73P0YOjqZ=Z7kyjPMm206ezMePTpQ@mail.gmail.com>
On Wed, May 28, 2025 at 11:25:20AM -0600, James Hilliard wrote:
> On Wed, May 28, 2025 at 8:12 AM Chen-Yu Tsai <wens@csie.org> wrote:
> >
> > On Wed, May 28, 2025 at 9:25 PM Andrew Lunn <andrew@lunn.ch> wrote:
> > >
> > > On Wed, May 28, 2025 at 05:57:38AM -0600, James Hilliard wrote:
> > > > On Wed, May 28, 2025 at 1:53 AM Russell King (Oracle)
> > > > <linux@armlinux.org.uk> wrote:
> > > > >
> > > > > On Tue, May 27, 2025 at 02:37:03PM -0600, James Hilliard wrote:
> > > > > > On Tue, May 27, 2025 at 2:30 PM Andrew Lunn <andrew@lunn.ch> wrote:
> > > > > > >
> > > > > > > > Sure, that may make sense to do as well, but I still don't see
> > > > > > > > how that impacts the need to runtime select the PHY which
> > > > > > > > is configured for the correct MFD.
> > > > > > >
> > > > > > > If you know what variant you have, you only include the one PHY you
> > > > > > > actually have, and phy-handle points to it, just as normal. No runtime
> > > > > > > selection.
> > > > > >
> > > > > > Oh, so here's the issue, we have both PHY variants, older hardware
> > > > > > generally has AC200 PHY's while newer ships AC300 PHY's, but
> > > > > > when I surveyed our deployed hardware using these boards many
> > > > > > systems of similar age would randomly mix AC200 and AC300 PHY's.
> > > > > >
> > > > > > It appears there was a fairly long transition period where both variants
> > > > > > were being shipped.
> > > > >
> > > > > Given that DT is supposed to describe the hardware that is being run on,
> > > > > it should _describe_ _the_ _hardware_ that the kernel is being run on.
> > > > >
> > > > > That means not enumerating all possibilities in DT and then having magic
> > > > > in the kernel to select the right variant. That means having a correct
> > > > > description in DT for the kernel to use.
> > > >
> > > > The approach I'm using is IMO quite similar to say other hardware
> > > > variant runtime detection DT features like this:
> > > > https://github.com/torvalds/linux/commit/157ce8f381efe264933e9366db828d845bade3a1
> > >
> > > That is for things link a HAT on a RPi. It is something which is easy
> > > to replace, and is expected to be replaced.
> >
> > Actually it's for second sourced components that are modules _within_
> > the device (a tablet or a laptop) that get swapped in at the factory.
> > Definitely not something easy to replace and not expected to be replaced
> > by the end user.
>
> Yeah, to me it seems like the PHY situation is similar, it's not replaceable
> due to being copackaged, it seems the vendor just switched over to a
> second source for the PHY partway through the production run without
> distinguishing different SoC variants with new model numbers.
>
> Keep in mind stmmac itself implements mdio PHY scanning already,
> which is a form of runtime PHY autodetection, so I don't really see
> how doing nvmem/efuse based PHY autodetection is all that different
> from that as both are forms of PHY runtime autodetection.
What is different is using "phys" and "phy-names" which historically
has never been used for ethernet PHYs. These have been used for serdes
PHYs (e.g. multi-protocol PHYs that support PCIe, SATA, and ethernet
protocols but do not provide ethernet PHY capability).
Historically, "phys" and "phy-names" have been the domain of
drivers/phy and not drivers/net/phy. drivers/net/phy PHYs have
been described using "phy-handle".
So, you're deviating from the common usage pattern, and I'm not sure
whether that has been made clear to the DT maintainers that that is
what is going on in this patch series.
As for the PHY scanning is a driver implementation issue; it doesn't
have any effect on device tree, it doesn't "abuse" DT properties to
do so. The PHY scanning is likely historical, probably from times
where the stmmac platform data was provided by board files (thus
having the first detected PHY made things simpler.) Therefore, I
don't think using it as a justification for more "autodetection"
stands up.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2025-05-28 18:37 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 17:55 [PATCH v2 1/3] net: stmmac: allow drivers to explicitly select PHY device James Hilliard
2025-05-27 17:55 ` [PATCH v2 2/3] net: stmmac: dwmac-sun8i: Allow runtime AC200/AC300 phy selection James Hilliard
2025-05-27 17:55 ` [PATCH v2 3/3] dt-bindings: net: sun8i-emac: Add AC300 EMAC1 nvmem " James Hilliard
2025-05-27 19:14 ` [PATCH v2 1/3] net: stmmac: allow drivers to explicitly select PHY device Andrew Lunn
2025-05-27 19:21 ` James Hilliard
2025-05-27 20:01 ` Andrew Lunn
2025-05-27 20:16 ` James Hilliard
2025-05-27 20:30 ` Andrew Lunn
2025-05-27 20:37 ` James Hilliard
2025-05-27 21:48 ` Andrew Lunn
2025-05-27 22:47 ` James Hilliard
2025-05-28 7:53 ` Russell King (Oracle)
2025-05-28 11:57 ` James Hilliard
2025-05-28 13:24 ` Andrew Lunn
2025-05-28 14:11 ` Chen-Yu Tsai
2025-05-28 17:25 ` James Hilliard
2025-05-28 18:34 ` Russell King (Oracle) [this message]
2025-05-28 19:10 ` James Hilliard
2025-05-28 19:26 ` Andrew Lunn
2025-05-28 19:45 ` James Hilliard
2025-05-28 21:05 ` Andrew Lunn
2025-05-28 21:14 ` James Hilliard
2025-05-28 21:29 ` Andrew Lunn
2025-05-28 21:45 ` James Hilliard
2025-05-28 23:47 ` Andrew Lunn
2025-05-29 0:31 ` James Hilliard
2025-05-30 23:46 ` James Hilliard
2025-05-30 23:56 ` Florian Fainelli
2025-05-31 0:02 ` James Hilliard
2025-05-31 0:24 ` Florian Fainelli
2025-05-31 0:49 ` James Hilliard
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=aDdXRPD2NpiZMsfZ@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=0x1207@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hayashi.kunihiko@socionext.com \
--cc=james.hilliard1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wens@csie.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).