]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: fix EEE init issue when paired with EEE capable PHYs
authorWong Vee Khee <vee.khee.wong@linux.intel.com>
Thu, 30 Sep 2021 06:44:36 +0000 (14:44 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Sep 2021 13:12:30 +0000 (14:12 +0100)
When STMMAC is paired with Energy-Efficient Ethernet(EEE) capable PHY,
and the PHY is advertising EEE by default, we need to enable EEE on the
xPCS side too, instead of having user to manually trigger the enabling
config via ethtool.

Fixed this by adding xpcs_config_eee() call in stmmac_eee_init().

Fixes: f01a4bb840be ("net: pcs: Introducing support for DWC xpcs Energy Efficient Ethernet")
Cc: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 553c4403258aa2c30cb2ca06f30f2db69efc6f3f..981ccf47dceac95fa870818dc455d77e2849a078 100644 (file)
@@ -486,6 +486,10 @@ bool stmmac_eee_init(struct stmmac_priv *priv)
                timer_setup(&priv->eee_ctrl_timer, stmmac_eee_ctrl_timer, 0);
                stmmac_set_eee_timer(priv, priv->hw, STMMAC_DEFAULT_LIT_LS,
                                     eee_tw_timer);
+               if (priv->hw->xpcs)
+                       xpcs_config_eee(priv->hw->xpcs,
+                                       priv->plat->mult_fact_100ns,
+                                       true);
        }
 
        if (priv->plat->has_gmac4 && priv->tx_lpi_timer <= STMMAC_ET_MAX) {