lkml.org 
[lkml]   [2010]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[2.6.37-rc1, patch] r8169: fix sleeping while holding spinlock...
From
Recent changes to the r8169 driver cause it to call
device_set_wakeup_enable under spinlock, which may sleep.

Locking isn't necessary around the call to device_set_wakeup_enable,
so drop the spinlock before calling it, to address this.

Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com>

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index d88ce9f..894e7c7 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -846,10 +846,10 @@ static int rtl8169_set_wol(struct net_device
*dev, struct ethtool_wolinfo *wol)
else
tp->features &= ~RTL_FEATURE_WOL;
__rtl8169_set_wol(tp, wol->wolopts);
- device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
-
spin_unlock_irq(&tp->lock);

+ device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
+
return 0;
}

--
Daniel J Blueman

\
 
 \ /
  Last update: 2010-11-01 22:39    [W:0.821 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site