Skip to content

Commit 7241c5a

Browse files
wvoondavem330
authored andcommitted
net: stmmac: removed enabling eee in EEE set callback
EEE should be only be enabled during stmmac_mac_link_up() when the link are up and being set up properly. set_eee should only do settings configuration and disabling the eee. Without this fix, turning on EEE using ethtool will return "Operation not supported". This is due to the driver is in a dead loop waiting for eee to be advertised in the for eee to be activated but the driver will only configure the EEE advertisement after the eee is activated. Ethtool should only return "Operation not supported" if there is no EEE capbility in the MAC controller. Fixes: 8a7493e ("net: stmmac: Fix a race in EEE enable callback") Signed-off-by: Voon Weifeng <[email protected]> Acked-by: Mark Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f9317ae commit 7241c5a

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -675,23 +675,16 @@ static int stmmac_ethtool_op_set_eee(struct net_device *dev,
675675
struct stmmac_priv *priv = netdev_priv(dev);
676676
int ret;
677677

678-
if (!edata->eee_enabled) {
678+
if (!priv->dma_cap.eee)
679+
return -EOPNOTSUPP;
680+
681+
if (!edata->eee_enabled)
679682
stmmac_disable_eee_mode(priv);
680-
} else {
681-
/* We are asking for enabling the EEE but it is safe
682-
* to verify all by invoking the eee_init function.
683-
* In case of failure it will return an error.
684-
*/
685-
edata->eee_enabled = stmmac_eee_init(priv);
686-
if (!edata->eee_enabled)
687-
return -EOPNOTSUPP;
688-
}
689683

690684
ret = phylink_ethtool_set_eee(priv->phylink, edata);
691685
if (ret)
692686
return ret;
693687

694-
priv->eee_enabled = edata->eee_enabled;
695688
priv->tx_lpi_timer = edata->tx_lpi_timer;
696689
return 0;
697690
}

0 commit comments

Comments
 (0)