[PATCH 3/3] drivers: net: ethernet: stmmac: fix resume function

From
Bob Liu <hidden>
Date
2012-05-22 07:38:36
Reply to
Bob Liu, 2012-05-22
After wake up from mem, ping fails to work.
This patch fix the resume function in stmmac driver.

Signed-off-by: Bob Liu <redacted>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 714faa2..22243a5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1952,6 +1952,15 @@ int stmmac_resume(struct net_device *ndev)
 		priv->hw->mac->pmt(priv->ioaddr, 0);
 
 	netif_device_attach(ndev);
+	priv->dirty_tx = 0;
+	priv->cur_tx = 0;
+	priv->cur_rx = 0;
+	priv->dirty_rx = 0;
+
+	/* DMA initialization and SW reset */
+	priv->hw->dma->init(priv->ioaddr, priv->plat->pbl,
+			priv->dma_tx_phy, priv->dma_rx_phy);
+	priv->hw->mac->core_init(priv->ioaddr);
 
 	/* Enable the MAC and DMA */
 	stmmac_set_mac(priv->ioaddr, true);
-- 
1.7.0.4
Thread (14 messages) 14 messages, 4 authors, last reply 2012-05-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help