Skip to content

Commit c9f5a5d

Browse files
hkallweitkuba-moo
authored andcommitted
net: ethernet: ti: cpsw: disable PHY EEE advertisement
It seems the cpsw MAC doesn't support EEE. See e.g. the commit message of ce28994 ("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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b55498f commit c9f5a5d

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

drivers/net/ethernet/ti/cpsw.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
635635

636636
slave->phy = phy;
637637

638+
phy_disable_eee(slave->phy);
639+
638640
phy_attached_info(slave->phy);
639641

640642
phy_start(slave->phy);
@@ -1225,7 +1227,6 @@ static const struct ethtool_ops cpsw_ethtool_ops = {
12251227
.get_link_ksettings = cpsw_get_link_ksettings,
12261228
.set_link_ksettings = cpsw_set_link_ksettings,
12271229
.get_eee = cpsw_get_eee,
1228-
.set_eee = cpsw_set_eee,
12291230
.nway_reset = cpsw_nway_reset,
12301231
.get_ringparam = cpsw_get_ringparam,
12311232
.set_ringparam = cpsw_set_ringparam,

drivers/net/ethernet/ti/cpsw_ethtool.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -434,18 +434,6 @@ int cpsw_get_eee(struct net_device *ndev, struct ethtool_keee *edata)
434434
return -EOPNOTSUPP;
435435
}
436436

437-
int cpsw_set_eee(struct net_device *ndev, struct ethtool_keee *edata)
438-
{
439-
struct cpsw_priv *priv = netdev_priv(ndev);
440-
struct cpsw_common *cpsw = priv->cpsw;
441-
int slave_no = cpsw_slave_index(cpsw, priv);
442-
443-
if (cpsw->slaves[slave_no].phy)
444-
return phy_ethtool_set_eee(cpsw->slaves[slave_no].phy, edata);
445-
else
446-
return -EOPNOTSUPP;
447-
}
448-
449437
int cpsw_nway_reset(struct net_device *ndev)
450438
{
451439
struct cpsw_priv *priv = netdev_priv(ndev);

drivers/net/ethernet/ti/cpsw_new.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,8 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
778778

779779
slave->phy = phy;
780780

781+
phy_disable_eee(slave->phy);
782+
781783
phy_attached_info(slave->phy);
782784

783785
phy_start(slave->phy);
@@ -1209,7 +1211,6 @@ static const struct ethtool_ops cpsw_ethtool_ops = {
12091211
.get_link_ksettings = cpsw_get_link_ksettings,
12101212
.set_link_ksettings = cpsw_set_link_ksettings,
12111213
.get_eee = cpsw_get_eee,
1212-
.set_eee = cpsw_set_eee,
12131214
.nway_reset = cpsw_nway_reset,
12141215
.get_ringparam = cpsw_get_ringparam,
12151216
.set_ringparam = cpsw_set_ringparam,

drivers/net/ethernet/ti/cpsw_priv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ int cpsw_get_link_ksettings(struct net_device *ndev,
497497
int cpsw_set_link_ksettings(struct net_device *ndev,
498498
const struct ethtool_link_ksettings *ecmd);
499499
int cpsw_get_eee(struct net_device *ndev, struct ethtool_keee *edata);
500-
int cpsw_set_eee(struct net_device *ndev, struct ethtool_keee *edata);
501500
int cpsw_nway_reset(struct net_device *ndev);
502501
void cpsw_get_ringparam(struct net_device *ndev,
503502
struct ethtool_ringparam *ering,

0 commit comments

Comments
 (0)