Subject: Re: [PATCH net-next v6 5/8] net: phy: Immediately call adjust_link if only tx_lpi_enabled changes

From: "Russell King (Oracle)" <[email-masked]>
Date: Fri, 23 Feb 2024 10:38:20 +0000

On Fri, Feb 23, 2024 at 10:44:22AM +0100, Oleksij Rempel wrote:
> +static void phy_ethtool_set_eee_noneg(struct phy_device *phydev,
> +				      struct ethtool_keee *data)
> +{
> +	if (phydev->eee_cfg.tx_lpi_enabled !=
> +	    data->tx_lpi_enabled) {
> +		eee_to_eeecfg(data, &phydev->eee_cfg);
> +		phydev->enable_tx_lpi = eeecfg_mac_can_tx_lpi(&phydev->eee_cfg);
> +		if (phydev->link)
> +			phy_link_up(phydev);

I'm not convinced this is a good idea. Hasn't phylib previously had
the guarantee that the link will go down between two link-up events?
So calling phy_link_up() may result in either the MAC driver ignoring
it, or modifying registers that are only supposed to be modified while
the MAC side is down.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!