[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZeD05pY1RdKNtrDZ@shell.armlinux.org.uk>
Date: Thu, 29 Feb 2024 21:19:34 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
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>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
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 v7 5/8] net: phy: Immediately call adjust_link
if only tx_lpi_enabled changes
On Thu, Feb 29, 2024 at 03:07:57PM +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 ||
> + 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) {
> + phy_link_down(phydev);
> + phy_link_up(phydev);
Unfortunately, this isn't sufficient in all cases. Phylink will be fine
with this though.
If we take a look at fec_enet_adjust_link(), then we can see it tests
phydev->link directly (which it has to, because there's nothing else
to determine whether the link is up or down. FEC will cope with its
fec_enet_adjust_link() being called with no changes however.
In order to properly resolve this, I think we need:
if (phydev->link) {
phydev->link = false;
phy_link_down(phydev);
phydev->link = true;
phy_link_up(phydev);
to properly avoid the issue I've referred to.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists