aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Virlinzi <francesco.virlinzi@st.com>2011-11-16 16:58:02 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-17 03:13:42 -0500
commit102463b18d922dd55c29fbfa222e0355ecf3e42f (patch)
tree8491bc4dcb12cef135d07461042a198692952b91
parent989508ba60da6dce79f8aaee1be6c092fd4c67f8 (diff)
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>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 29dd87c675dc..8ea770a89f25 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2011,12 +2011,13 @@ static int stmmac_suspend(struct device *dev)
2011 if (!ndev || !netif_running(ndev)) 2011 if (!ndev || !netif_running(ndev))
2012 return 0; 2012 return 0;
2013 2013
2014 if (priv->phydev)
2015 phy_stop(priv->phydev);
2016
2014 spin_lock(&priv->lock); 2017 spin_lock(&priv->lock);
2015 2018
2016 netif_device_detach(ndev); 2019 netif_device_detach(ndev);
2017 netif_stop_queue(ndev); 2020 netif_stop_queue(ndev);
2018 if (priv->phydev)
2019 phy_stop(priv->phydev);
2020 2021
2021#ifdef CONFIG_STMMAC_TIMER 2022#ifdef CONFIG_STMMAC_TIMER
2022 priv->tm->timer_stop(); 2023 priv->tm->timer_stop();
@@ -2074,12 +2075,13 @@ static int stmmac_resume(struct device *dev)
2074#endif 2075#endif
2075 napi_enable(&priv->napi); 2076 napi_enable(&priv->napi);
2076 2077
2077 if (priv->phydev)
2078 phy_start(priv->phydev);
2079
2080 netif_start_queue(ndev); 2078 netif_start_queue(ndev);
2081 2079
2082 spin_unlock(&priv->lock); 2080 spin_unlock(&priv->lock);
2081
2082 if (priv->phydev)
2083 phy_start(priv->phydev);
2084
2083 return 0; 2085 return 0;
2084} 2086}
2085 2087