From: Yixun Lan Date: Sat, 9 Sep 2017 13:36:29 +0000 (+0800) Subject: eth: stmmac: fix timer expire issue in resume stage X-Git-Tag: khadas-vims-v0.9.6-release~2839 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a8f830bf48224ec215d9f0b9d327eedd1162692;p=platform%2Fkernel%2Flinux-amlogic.git 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 --- 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);