提交 102463b1 编写于 作者: F Francesco Virlinzi 提交者: David S. Miller

stmmac: fix pm functions avoiding sleep on spinlock

This patch fixes the pm functions to avoid the system
sleeps while a spinlock is taken.
Signed-off-by: NFrancesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 989508ba
......@@ -2011,12 +2011,13 @@ static int stmmac_suspend(struct device *dev)
if (!ndev || !netif_running(ndev))
return 0;
if (priv->phydev)
phy_stop(priv->phydev);
spin_lock(&priv->lock);
netif_device_detach(ndev);
netif_stop_queue(ndev);
if (priv->phydev)
phy_stop(priv->phydev);
#ifdef CONFIG_STMMAC_TIMER
priv->tm->timer_stop();
......@@ -2074,12 +2075,13 @@ static int stmmac_resume(struct device *dev)
#endif
napi_enable(&priv->napi);
if (priv->phydev)
phy_start(priv->phydev);
netif_start_queue(ndev);
spin_unlock(&priv->lock);
if (priv->phydev)
phy_start(priv->phydev);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册