lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Mar 2023 19:02:01 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     netdev <netdev@...r.kernel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Oleksij Rempel <o.rempel@...gutronix.de>
Subject: Re: [RFC/RFT 05/23] net: phy: Immediately call adjust_link if only
 tx_lpi_enabled changes

On Mon, Mar 27, 2023 at 07:01:43PM +0200, Andrew Lunn wrote:
> The MAC driver changes its EEE hardware configuration in its
> adjust_link callback. This is called when auto-neg completes. If
> set_eee is called with 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->eee_active, take tx_lpi_enabled into account, so
> the MAC drivers don't need to consider tx_lpi_enabled.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>

Hmm..

> @@ -1619,11 +1619,20 @@ int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data)
>  
>  	mutex_lock(&phydev->lock);
>  	ret = genphy_c45_ethtool_set_eee(phydev, data);
> -	if (!ret)
> +	if (ret >= 0) {
> +		if (ret == 0) {
> +			/* auto-neg not triggered */
> +			if (phydev->tx_lpi_enabled != data->tx_lpi_enabled) {
> +				phydev->tx_lpi_enabled = data->tx_lpi_enabled;
> +				if (phydev->link)
> +					phy_link_up(phydev);
> +			}
> +		}
>  		phydev->tx_lpi_enabled = data->tx_lpi_enabled;

So we set eee_active depending on tx_lpi_enabled:

> +			phydev->eee_active = (err & phydev->tx_lpi_enabled);

However, if tx_lpi_enabled changes state in this function, we don't
update phydev->eee_active, but it's phydev->eee_active that gets
passed back to MAC drivers. Is that intentional?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ