net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC
[linux-block.git] / drivers / net / ethernet / stmicro / stmmac / stmmac_main.c
index c6951c976f5ddb2b67dc760bbb433c871c3efab4..1a5b8dab5e9b65e0ebf634fc6d9691952c148acc 100644 (file)
@@ -1080,7 +1080,8 @@ static void stmmac_mac_link_up(struct phylink_config *config,
 
        stmmac_mac_set(priv, priv->ioaddr, true);
        if (phy && priv->dma_cap.eee) {
-               priv->eee_active = phy_init_eee(phy, 1) >= 0;
+               priv->eee_active =
+                       phy_init_eee(phy, !priv->plat->rx_clk_runs_in_lpi) >= 0;
                priv->eee_enabled = stmmac_eee_init(priv);
                priv->tx_lpi_enabled = priv->eee_enabled;
                stmmac_set_eee_pls(priv, priv->hw, true);
@@ -1150,6 +1151,11 @@ static int stmmac_init_phy(struct net_device *dev)
                int addr = priv->plat->phy_addr;
                struct phy_device *phydev;
 
+               if (addr < 0) {
+                       netdev_err(priv->dev, "no phy found\n");
+                       return -ENODEV;
+               }
+
                phydev = mdiobus_get_phy(priv->mii, addr);
                if (!phydev) {
                        netdev_err(priv->dev, "no phy at addr %d\n", addr);