Re: [PATCH net-next 1/7] net: phy: allow isolating PHY devices

From: Maxime Chevallier
Date: Fri Sep 13 2024 - 03:45:29 EST


Hello Florian,

On Thu, 12 Sep 2024 11:30:26 -0700
Florian Fainelli <f.fainelli@xxxxxxxxx> wrote:

> On 9/11/24 14:27, Maxime Chevallier wrote:
> > The 802.3 specifications describes the isolation mode as setting the
> > PHY's MII interface in high-impedance mode, thus isolating the PHY from
> > that bus. This effectively breaks the link between the MAC and the PHY,
> > but without necessarily disrupting the link between the PHY and the LP.
> >
> > This mode can be useful for testing purposes, but also when there are
> > multiple PHYs on the same MII bus (a case that the 802.3 specification
> > refers to).
> >
> > In Isolation mode, the PHY will still continue to respond to MDIO
> > commands.
> >
> > Introduce a helper to set the phy in an isolated mode.
> >
> > Signed-off-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>
>
> Not sure where that comment belongs so I will put it here, one thing
> that concerns me is if you have hardware that is not strapped to be
> isolated by default, and the PHY retains the state configured by Linux,
> such that the PHY is in isolation mode. A boot loader that is not
> properly taking the PHY out of isolation mode would be unavailable to
> use it and that would be a bug that Linux would likely be on the hook to
> fix.
>
> Would recommend adding a phy_shutdown() method which is called upon
> reboot/kexec and which, based upon a quirk/flag can ensure that the
> isolation bit is cleared.

Very good point. I can see the same problem occuring with loopback then
(if we use the 802.3 C22 PHY loopback bit).

I have such a patch ready actually, for the 2-PHYs-on-the-same-MAC
scenario, I will include it in the next iteration.

Thanks for your feedback,

Maxime