Skip to content

Commit 36d18b5

Browse files
fugangduandavem330
authored andcommitted
net: stmmac: start phylink instance before stmmac_hw_setup()
Start phylink instance and resume back the PHY to supply RX clock to MAC before MAC layer initialization by calling .stmmac_hw_setup(), since DMA reset depends on the RX clock, otherwise DMA reset cost maximum timeout value then finally timeout. Fixes: 7437127 ("net: stmmac: Convert to phylink and remove phylib logic") Signed-off-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9d14edf commit 36d18b5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5247,6 +5247,14 @@ int stmmac_resume(struct device *dev)
52475247
return ret;
52485248
}
52495249

5250+
if (!device_may_wakeup(priv->device) || !priv->plat->pmt) {
5251+
rtnl_lock();
5252+
phylink_start(priv->phylink);
5253+
/* We may have called phylink_speed_down before */
5254+
phylink_speed_up(priv->phylink);
5255+
rtnl_unlock();
5256+
}
5257+
52505258
rtnl_lock();
52515259
mutex_lock(&priv->lock);
52525260

@@ -5265,14 +5273,6 @@ int stmmac_resume(struct device *dev)
52655273
mutex_unlock(&priv->lock);
52665274
rtnl_unlock();
52675275

5268-
if (!device_may_wakeup(priv->device) || !priv->plat->pmt) {
5269-
rtnl_lock();
5270-
phylink_start(priv->phylink);
5271-
/* We may have called phylink_speed_down before */
5272-
phylink_speed_up(priv->phylink);
5273-
rtnl_unlock();
5274-
}
5275-
52765276
phylink_mac_change(priv->phylink, true);
52775277

52785278
netif_device_attach(ndev);

0 commit comments

Comments
 (0)