Browse Source

dwc_eth_qos: Reset hardware before PHY start

The hardware reset is currently done after phy_start() is called,
leading to a race where we can lose the link status if the phy state
machine calls dwceqos_adjust_link() before we reset the MAC registers.

Acked-by: Lars Persson <larper@axis.com>
Signed-off-by: Rabin Vincent <rabinv@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rabin Vincent 9 years ago
parent
commit
3647bc35bd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/ethernet/synopsys/dwc_eth_qos.c

+ 1 - 1
drivers/net/ethernet/synopsys/dwc_eth_qos.c

@@ -1880,9 +1880,9 @@ static int dwceqos_open(struct net_device *ndev)
 	}
 	netdev_reset_queue(ndev);
 
+	dwceqos_init_hw(lp);
 	napi_enable(&lp->napi);
 	phy_start(lp->phy_dev);
-	dwceqos_init_hw(lp);
 
 	netif_start_queue(ndev);
 	tasklet_enable(&lp->tx_bdreclaim_tasklet);