From 40e1a40141ab8fdc1be44dd917c1242e93875a29 Mon Sep 17 00:00:00 2001 From: qi duan Date: Thu, 22 Aug 2019 05:45:15 -0400 Subject: [PATCH] ETH: remove release open when resume for amlogic phy. [1/1] PD#SWPL-13132 Problem: stammac release/open when resume will change the dma addr. if stmmac_xmit and stmmac_tx_work are running at the same time it will cause panic Solution: remove stmmac_release/open call in stmmac_resume for chip g12a/g12b/tl1/tm2 Verify: verify on TL1 Change-Id: I5abf2ccf72c39483bbd1cce7b9e24bf596f30d0f Signed-off-by: qi duan --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++++--- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a76fbcf..f7e1a9a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -54,7 +54,9 @@ #include #include #include "dwmac1000.h" - +#ifdef CONFIG_AMLOGIC_ETH_PRIVE +#include "stmmac_platform.h" +#endif #ifdef CONFIG_DWMAC_MESON #include #endif @@ -3672,8 +3674,10 @@ int stmmac_resume(struct device *dev) phy_start(priv->phydev); #ifdef TX_MONITOR - stmmac_release(priv_monitor->dev); - stmmac_open(priv_monitor->dev); + if (!ee_reset_base) { + stmmac_release(priv_monitor->dev); + stmmac_open(priv_monitor->dev); + } #endif return 0; } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h index 5b44e9b..7cd591a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h @@ -35,6 +35,7 @@ int stmmac_pltfr_suspend(struct device *dev); int stmmac_pltfr_resume(struct device *dev); extern unsigned int external_rx_delay; extern unsigned int external_tx_delay; +extern void __iomem *ee_reset_base; #endif extern const struct dev_pm_ops stmmac_pltfr_pm_ops; -- 2.7.4