Skip to content

Commit

Permalink
net: fec: init MAC prior to mii bus probe
Browse files Browse the repository at this point in the history
Below case causes mii bus probe failed:
ifconfig eth0 down -> suspend/resume with Mega/fax mix off -> ifconfig eth0 up

In i.MX6SX/i.MX7D chip, Mega/fast mix off feature is supported that means most of
SOC power will be off including ENET MAC for power saving. Once ENET MAC power
off, all initialized MAC registers reset to default, so in the case, it must
init MAC prior to mii bus probe.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nimrod Andy authored and David S. Miller committed Jun 23, 2015
1 parent 42bcce8 commit 55dd275
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2856,12 +2856,14 @@ fec_enet_open(struct net_device *ndev)
if (ret)
goto err_enet_alloc;

/* Init MAC prior to mii bus probe */
fec_restart(ndev);

/* Probe and connect to PHY when open the interface */
ret = fec_enet_mii_probe(ndev);
if (ret)
goto err_enet_mii_probe;

fec_restart(ndev);
napi_enable(&fep->napi);
phy_start(fep->phy_dev);
netif_tx_start_all_queues(ndev);
Expand Down

0 comments on commit 55dd275

Please sign in to comment.