diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-11-09 06:54:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-12 17:05:43 -0500 |
commit | 6c4f199411f254bf3713b04ed8653f0955883309 (patch) | |
tree | 64c4ea35c4faed4709e8e2c8c4f119e31715c129 | |
parent | 403856532734317d25ec86ab1e75b8133db7acc6 (diff) |
gianfar: Do not call device_set_wakeup_enable() under a spinlock
The gianfar driver calls device_set_wakeup_enable() under a spinlock,
which causes a problem to happen after the recent core power
management changes, because this function can sleep now. Fix this
by moving the device_set_wakeup_enable() call out of the
spinlock-protected area.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/gianfar_ethtool.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index 5c566ebc54b8..3bc8e276ba4d 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c | |||
@@ -635,9 +635,10 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
635 | if (wol->wolopts & ~WAKE_MAGIC) | 635 | if (wol->wolopts & ~WAKE_MAGIC) |
636 | return -EINVAL; | 636 | return -EINVAL; |
637 | 637 | ||
638 | device_set_wakeup_enable(&dev->dev, wol->wolopts & WAKE_MAGIC); | ||
639 | |||
638 | spin_lock_irqsave(&priv->bflock, flags); | 640 | spin_lock_irqsave(&priv->bflock, flags); |
639 | priv->wol_en = wol->wolopts & WAKE_MAGIC ? 1 : 0; | 641 | priv->wol_en = !!device_may_wakeup(&dev->dev); |
640 | device_set_wakeup_enable(&dev->dev, priv->wol_en); | ||
641 | spin_unlock_irqrestore(&priv->bflock, flags); | 642 | spin_unlock_irqrestore(&priv->bflock, flags); |
642 | 643 | ||
643 | return 0; | 644 | return 0; |