From: Jose Abreu Date: Fri, 28 Jun 2019 07:29:13 +0000 (+0200) Subject: net: stmmac: Do not try to enable PHY EEE if MAC does not support it X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=5b1117704d4c59f5dc8df033e418f02838d4a130;p=openwrt%2Fstaging%2Fblogic.git net: stmmac: Do not try to enable PHY EEE if MAC does not support it Do not enable EEE feature in the PHY if MAC does not support it. Signed-off-by: Jose Abreu Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 91f24b63ea16..0b1900bf4e9e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -896,7 +896,7 @@ static void stmmac_mac_link_up(struct phylink_config *config, struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev)); stmmac_mac_set(priv, priv->ioaddr, true); - if (phy) { + if (phy && priv->dma_cap.eee) { priv->eee_active = phy_init_eee(phy, 1) >= 0; priv->eee_enabled = stmmac_eee_init(priv); stmmac_set_eee_pls(priv, priv->hw, true);