[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8cafe975-e898-4f6a-9389-0a655d6dae22@lunn.ch>
Date: Fri, 1 Mar 2024 23:38:52 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Wei Fang <wei.fang@....com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Florian Fainelli <florian.fainelli@...adcom.com>,
kernel@...gutronix.de, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, Shenwei Wang <shenwei.wang@....com>,
Clark Wang <xiaoning.wang@....com>,
NXP Linux Team <linux-imx@....com>
Subject: Re: [PATCH net-next v8 5/8] net: phy: Immediately call adjust_link
if only tx_lpi_enabled changes
On Fri, Mar 01, 2024 at 11:01:50AM +0100, Oleksij Rempel wrote:
> From: Andrew Lunn <andrew@...n.ch>
>
> The MAC driver changes its EEE hardware configuration in its
> adjust_link callback. This is called when auto-neg
> completes. Disabling EEE via eee_enabled false will trigger an
> autoneg, and as a result the adjust_link callback will be called with
> phydev->enable_tx_lpi set to false. Similarly, eee_enabled set to true
> and with a change of advertised link modes will result in a new
> autoneg, and a call the adjust_link call.
>
> If set_eee is called with only a change to tx_lpi_enabled which does
> not trigger an auto-neg, it is necessary to call the adjust_link
> callback so that the MAC is reconfigured to take this change into
> account.
>
> When setting phydev->enable_tx_lpi, take both eee_enabled and
> tx_lpi_enabled into account, so the MAC drivers just needs to act on
> phydev->enable_tx_lpi and not the whole EEE configuration.
> The same check should be done for tx_lpi_timer too.
>
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> +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 ||
> + phydev->eee_cfg.tx_lpi_timer != data->tx_lpi_timer) {
> + eee_to_eeecfg(data, &phydev->eee_cfg);
> + phydev->enable_tx_lpi = eeecfg_mac_can_tx_lpi(&phydev->eee_cfg);
> + if (phydev->link) {
> + phydev->link = false;
> + phy_link_down(phydev);
> + phydev->link = true;
> + phy_link_up(phydev);
> + }
> + }
> +}
> +
Thanks
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists