diff options
author | Giuseppe Cavallaro <peppe.cavallaro@st.com> | 2010-09-06 05:02:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-07 13:57:14 -0700 |
commit | c4433be6e19e3680727f3f89c938a22e7b789b43 (patch) | |
tree | e5c70a0251b2da8112939cd0316061839e3242ef /drivers | |
parent | 3fb5a991916091a908d53608a5899240039fb51e (diff) | |
download | linux-stable-c4433be6e19e3680727f3f89c938a22e7b789b43.tar.gz linux-stable-c4433be6e19e3680727f3f89c938a22e7b789b43.tar.bz2 linux-stable-c4433be6e19e3680727f3f89c938a22e7b789b43.zip |
stmmac: fix sleep inside atomic
We cannot use spinlock when kmalloc is invoked with
GFP_KERNEL flag because it can sleep.
So this patch reviews the usage of spinlock within the
stmmac_resume function avoing this bug.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/stmmac/stmmac_main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index bbb7951b9c4c..ea0461eb2dbe 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c @@ -1865,15 +1865,15 @@ static int stmmac_resume(struct platform_device *pdev) if (!netif_running(dev)) return 0; - spin_lock(&priv->lock); - if (priv->shutdown) { /* Re-open the interface and re-init the MAC/DMA - and the rings. */ + and the rings (i.e. on hibernation stage) */ stmmac_open(dev); - goto out_resume; + return 0; } + spin_lock(&priv->lock); + /* Power Down bit, into the PM register, is cleared * automatically as soon as a magic packet or a Wake-up frame * is received. Anyway, it's better to manually clear @@ -1901,7 +1901,6 @@ static int stmmac_resume(struct platform_device *pdev) netif_start_queue(dev); -out_resume: spin_unlock(&priv->lock); return 0; } |