Re: [PATCH net-next v2 1/1] net: phy: Clear link-specific data on link down
From: Russell King (Oracle)
Date: Fri Aug 22 2025 - 05:19:55 EST
On Fri, Aug 22, 2025 at 11:09:47AM +0200, Oleksij Rempel wrote:
> When a network interface is brought down, the associated PHY is stopped.
> However, several link-specific parameters within the phy_device struct
> are not cleared. This leads to userspace tools like ethtool reporting
> stale information from the last active connection, which is misleading
> as the link is no longer active.
This is not a good idea. Consider the case where the PHY has been
configured with autoneg disabled, and phydev->speed etc specifies
the desired speed.
When the link goes down, all that state gets cleared, and we lose
the user's settings.
So no, I don't think this is appropriate.
I think it is appropriate to clear some of the state, but anything that
the user can configure (such as ->speed and ->duplex) must not be
cleared.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!