Commit c4433be6 authored by Giuseppe Cavallaro's avatar Giuseppe Cavallaro Committed by David S. Miller
Browse files

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: default avatarGiuseppe Cavallaro <>
Reported-by: default avatarJiri Slaby <>
Signed-off-by: default avatarDavid S. Miller <>
parent 3fb5a991
......@@ -1865,15 +1865,15 @@ static int stmmac_resume(struct platform_device *pdev)
if (!netif_running(dev))
return 0;
if (priv->shutdown) {
/* Re-open the interface and re-init the MAC/DMA
and the rings. */
and the rings (i.e. on hibernation stage) */
goto out_resume;
return 0;
/* 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)
return 0;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment