]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: ethernet: ti: cpsw: disable PHY EEE advertisement
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 16 Dec 2024 21:32:25 +0000 (22:32 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 20 Dec 2024 03:07:48 +0000 (19:07 -0800)
It seems the cpsw MAC doesn't support EEE. See e.g. the commit message of
ce2899428ec0 ("ARM: dts: am335x-baltos: disable EEE for Atheros 8035 PHY").
There are cases where this causes issues if the PHY's on both sides have
negotiated EEE. As a workaround EEE modes of the PHY are marked broken
in DT, effectively disabling EEE advertisement.
Improve this by using new function phy_disable_eee() in the MAC driver.
This properly disables EEE advertisement, and allows to remove the
eee-broken-xxx properties from DT. As EEE is disabled anyway, we can
remove also the set_eee ethtool op.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/d08a798e-8565-422c-b2ed-121794db077f@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/cpsw_ethtool.c
drivers/net/ethernet/ti/cpsw_new.c
drivers/net/ethernet/ti/cpsw_priv.h

index 4ef8cf6ea135a67ca0c3c18d1b5378feb3735c4a..1e290ee8edfd3a18a36c935c55b430241bda69f1 100644 (file)
@@ -635,6 +635,8 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
 
        slave->phy = phy;
 
+       phy_disable_eee(slave->phy);
+
        phy_attached_info(slave->phy);
 
        phy_start(slave->phy);
@@ -1225,7 +1227,6 @@ static const struct ethtool_ops cpsw_ethtool_ops = {
        .get_link_ksettings     = cpsw_get_link_ksettings,
        .set_link_ksettings     = cpsw_set_link_ksettings,
        .get_eee        = cpsw_get_eee,
-       .set_eee        = cpsw_set_eee,
        .nway_reset     = cpsw_nway_reset,
        .get_ringparam = cpsw_get_ringparam,
        .set_ringparam = cpsw_set_ringparam,
index 21d55a180ef6e8f4ffbdd0bfc26e208203617142..bdc4db0d169c48502ce45c50b2ea85b619b9fd3f 100644 (file)
@@ -434,18 +434,6 @@ int cpsw_get_eee(struct net_device *ndev, struct ethtool_keee *edata)
                return -EOPNOTSUPP;
 }
 
-int cpsw_set_eee(struct net_device *ndev, struct ethtool_keee *edata)
-{
-       struct cpsw_priv *priv = netdev_priv(ndev);
-       struct cpsw_common *cpsw = priv->cpsw;
-       int slave_no = cpsw_slave_index(cpsw, priv);
-
-       if (cpsw->slaves[slave_no].phy)
-               return phy_ethtool_set_eee(cpsw->slaves[slave_no].phy, edata);
-       else
-               return -EOPNOTSUPP;
-}
-
 int cpsw_nway_reset(struct net_device *ndev)
 {
        struct cpsw_priv *priv = netdev_priv(ndev);
index a98bcc5eb5663df16a2f032806e34891768d2903..be4d90c1cbe7f467c56ec7695bb1103443321047 100644 (file)
@@ -778,6 +778,8 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
 
        slave->phy = phy;
 
+       phy_disable_eee(slave->phy);
+
        phy_attached_info(slave->phy);
 
        phy_start(slave->phy);
@@ -1209,7 +1211,6 @@ static const struct ethtool_ops cpsw_ethtool_ops = {
        .get_link_ksettings     = cpsw_get_link_ksettings,
        .set_link_ksettings     = cpsw_set_link_ksettings,
        .get_eee                = cpsw_get_eee,
-       .set_eee                = cpsw_set_eee,
        .nway_reset             = cpsw_nway_reset,
        .get_ringparam          = cpsw_get_ringparam,
        .set_ringparam          = cpsw_set_ringparam,
index 1f448290b9f4b319284ee8dba3920b7173258f2f..f2fc55d9295dc1b7a46ccc1cb16d0e8fbabe45a2 100644 (file)
@@ -497,7 +497,6 @@ int cpsw_get_link_ksettings(struct net_device *ndev,
 int cpsw_set_link_ksettings(struct net_device *ndev,
                            const struct ethtool_link_ksettings *ecmd);
 int cpsw_get_eee(struct net_device *ndev, struct ethtool_keee *edata);
-int cpsw_set_eee(struct net_device *ndev, struct ethtool_keee *edata);
 int cpsw_nway_reset(struct net_device *ndev);
 void cpsw_get_ringparam(struct net_device *ndev,
                        struct ethtool_ringparam *ering,