From 7a8f830bf48224ec215d9f0b9d327eedd1162692 Mon Sep 17 00:00:00 2001 From: Yixun Lan Date: Sat, 9 Sep 2017 21:36:29 +0800 Subject: [PATCH] eth: stmmac: fix timer expire issue in resume stage PD#150780: eth: stmmac: fix timer expire issue in resume stage Change-Id: I1d154c1eb581972d6131871901ade2272a1192ad Signed-off-by: Yixun Lan --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 22b3e2d..3d9db66 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -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); -- 2.7.4