mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 15:45:45 +00:00
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: Francesco Virlinzi <francesco.virlinzi@st.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
989508ba60
commit
102463b18d
1 changed files with 7 additions and 5 deletions
|
@ -2011,12 +2011,13 @@ static int stmmac_suspend(struct device *dev)
|
||||||
if (!ndev || !netif_running(ndev))
|
if (!ndev || !netif_running(ndev))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (priv->phydev)
|
||||||
|
phy_stop(priv->phydev);
|
||||||
|
|
||||||
spin_lock(&priv->lock);
|
spin_lock(&priv->lock);
|
||||||
|
|
||||||
netif_device_detach(ndev);
|
netif_device_detach(ndev);
|
||||||
netif_stop_queue(ndev);
|
netif_stop_queue(ndev);
|
||||||
if (priv->phydev)
|
|
||||||
phy_stop(priv->phydev);
|
|
||||||
|
|
||||||
#ifdef CONFIG_STMMAC_TIMER
|
#ifdef CONFIG_STMMAC_TIMER
|
||||||
priv->tm->timer_stop();
|
priv->tm->timer_stop();
|
||||||
|
@ -2074,12 +2075,13 @@ static int stmmac_resume(struct device *dev)
|
||||||
#endif
|
#endif
|
||||||
napi_enable(&priv->napi);
|
napi_enable(&priv->napi);
|
||||||
|
|
||||||
if (priv->phydev)
|
|
||||||
phy_start(priv->phydev);
|
|
||||||
|
|
||||||
netif_start_queue(ndev);
|
netif_start_queue(ndev);
|
||||||
|
|
||||||
spin_unlock(&priv->lock);
|
spin_unlock(&priv->lock);
|
||||||
|
|
||||||
|
if (priv->phydev)
|
||||||
|
phy_start(priv->phydev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue