[PATCH RFC net-next 03/23] net: phy: marvell: use phydev->eee_cfg.eee_enabled
Heiner Kallweit
hkallweit1 at gmail.com
Tue Nov 26 12:19:39 PST 2024
On 26.11.2024 13:52, Russell King (Oracle) wrote:
> Rather than calling genphy_c45_ethtool_get_eee() to retrieve whether
> EEE is enabled, use the value stored in the phy_device eee_cfg
> structure.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
> ---
> drivers/net/phy/marvell.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index cd50cd6a7f75..1d117fa8c564 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -1508,7 +1508,6 @@ static int m88e1540_get_fld(struct phy_device *phydev, u8 *msecs)
>
> static int m88e1540_set_fld(struct phy_device *phydev, const u8 *msecs)
> {
> - struct ethtool_keee eee;
> int val, ret;
>
> if (*msecs == ETHTOOL_PHY_FAST_LINK_DOWN_OFF)
> @@ -1518,8 +1517,7 @@ static int m88e1540_set_fld(struct phy_device *phydev, const u8 *msecs)
> /* According to the Marvell data sheet EEE must be disabled for
> * Fast Link Down detection to work properly
> */
> - ret = genphy_c45_ethtool_get_eee(phydev, &eee);
> - if (!ret && eee.eee_enabled) {
> + if (phydev->eee_cfg.eee_enabled) {
> phydev_warn(phydev, "Fast Link Down detection requires EEE to be disabled!\n");
> return -EBUSY;
> }
This one I had on my list too. Old and new check aren't waterproof as the user can still
enable EEE later, silently disabling FLD. But the check is better than nothing.
Reviewed-by: Heiner Kallweit <hkallweit1 at gmail.com>
More information about the linux-arm-kernel
mailing list