eth: stmmac: fix timer expire issue in resume stage
authorYixun Lan <yixun.lan@amlogic.com>
Sat, 9 Sep 2017 13:36:29 +0000 (21:36 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 15 Sep 2017 03:23:43 +0000 (20:23 -0700)
PD#150780: eth: stmmac: fix timer expire issue in resume stage

Change-Id: I1d154c1eb581972d6131871901ade2272a1192ad
Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 22b3e2d..3d9db66 100644 (file)
@@ -3465,6 +3465,9 @@ int stmmac_suspend(struct device *dev)
        napi_disable(&priv->napi);
        spin_lock_irqsave(&priv->lock, flags);
 
+#ifdef CONFIG_AMLOGIC_ETH_PRIVE
+       del_timer_sync(&priv->txtimer);
+#endif
        /* Stop TX/RX DMA */
        priv->hw->dma->stop_tx(priv->ioaddr);
        priv->hw->dma->stop_rx(priv->ioaddr);
@@ -3525,8 +3528,9 @@ int stmmac_resume(struct device *dev)
                        stmmac_mdio_reset(priv->mii);
        }
 
+#ifndef CONFIG_AMLOGIC_ETH_PRIVE
        netif_device_attach(ndev);
-
+#endif
        spin_lock_irqsave(&priv->lock, flags);
 
        priv->cur_rx = 0;
@@ -3547,6 +3551,9 @@ int stmmac_resume(struct device *dev)
        stmmac_init_tx_coalesce(priv);
        stmmac_set_rx_mode(ndev);
 
+#ifdef CONFIG_AMLOGIC_ETH_PRIVE
+       netif_device_attach(ndev);
+#endif
        napi_enable(&priv->napi);
 
        netif_start_queue(ndev);