diff mbox

dwc_eth_qos: Reset hardware before PHY start

Message ID 1454402342-20477-1-git-send-email-rabin.vincent@axis.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Rabin Vincent Feb. 2, 2016, 8:39 a.m. UTC
From: Rabin Vincent <rabinv@axis.com>

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>
---
 drivers/net/ethernet/synopsys/dwc_eth_qos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Feb. 6, 2016, 8:38 a.m. UTC | #1
From: Rabin Vincent <rabin.vincent@axis.com>
Date: Tue, 2 Feb 2016 09:39:02 +0100

> From: Rabin Vincent <rabinv@axis.com>
> 
> 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>

Applied to 'net', thanks.
diff mbox

Patch

diff --git a/drivers/net/ethernet/synopsys/dwc_eth_qos.c b/drivers/net/ethernet/synopsys/dwc_eth_qos.c
index 70814b7..fc8bbff 100644
--- a/drivers/net/ethernet/synopsys/dwc_eth_qos.c
+++ b/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);