net: bcmgenet: move PHY initialization from probe() to start()
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 25 Mar 2020 09:01:48 +0000 (10:01 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 12 Oct 2022 05:45:59 +0000 (14:45 +0900)
Fix random network failures on subsequent network access by forcing PHY initialization on
every network access. This also fixes sudden link drop from 100baseT to 10baseT observed
from time to time.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I5bb55ce6546dec5449afea1bef036458563f287c

drivers/net/bcmgenet.c

index 4e1f8ed..555a690 100644 (file)
@@ -466,11 +466,17 @@ static int bcmgenet_adjust_link(struct bcmgenet_eth_priv *priv)
        return 0;
 }
 
+static int bcmgenet_phy_init(struct bcmgenet_eth_priv *priv, void *dev);
+
 static int bcmgenet_gmac_eth_start(struct udevice *dev)
 {
        struct bcmgenet_eth_priv *priv = dev_get_priv(dev);
        int ret;
 
+       ret = bcmgenet_phy_init(priv, dev);
+       if (ret)
+               return ret;
+
        priv->tx_desc_base = priv->mac_reg + GENET_TX_OFF;
        priv->rx_desc_base = priv->mac_reg + GENET_RX_OFF;
 
@@ -662,7 +668,7 @@ static int bcmgenet_eth_probe(struct udevice *dev)
 
        priv->bus = miiphy_get_dev_by_name(name);
 
-       return bcmgenet_phy_init(priv, dev);
+       return 0;
 }
 
 static void bcmgenet_gmac_eth_stop(struct udevice *dev)