aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-12-11 20:24:46 -0500
committerDavid S. Miller <davem@davemloft.net>2006-12-11 20:24:46 -0500
commita49f99ffca57a2eada23b1ac908a405c17859e35 (patch)
treeb05f86ca44f941205c6c763fe787ada0ca9116f5 /net
parent37004af3aaf28f39981754a05cf74361c0834a7a (diff)
[NETPOLL]: Fix local_bh_enable() warning.
During boot we get: netconsole: device eth0 not up yet, forcing it e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex WARNING (!__warned) at kernel/softirq.c:137 local_bh_enable() Call Trace: [<ffffffff80235baf>] local_bh_enable+0x41/0xa3 [<ffffffff8045ab8e>] netpoll_send_skb+0x116/0x144 [<ffffffff8045b1ee>] netpoll_send_udp+0x263/0x271 [<ffffffff803d41ec>] write_msg+0x42/0x5e [<ffffffff80230c9b>] __call_console_drivers+0x5f/0x70 [<ffffffff80230d19>] _call_console_drivers+0x6d/0x71 [<ffffffff802313f0>] release_console_sem+0x148/0x1ec [<ffffffff802316ce>] register_console+0x1b1/0x1ba [<ffffffff803d4178>] init_netconsole+0x54/0x68 [<ffffffff802071ae>] init+0x152/0x308 [<ffffffff804dac8b>] _spin_unlock_irq+0x14/0x30 [<ffffffff8022c15e>] schedule_tail+0x43/0x9f [<ffffffff8020a758>] child_rip+0xa/0x12 Herbert sayeth: Normally networking isn't invoked with interrupts turned off, but I suppose we don't have a choice here. This is unique being a place where you can get called with BH on, off, or IRQs off. Given that this is only used for printk, the easiest solution is probably just to disable local IRQs instead of BH. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/netpoll.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 156d7fd81fec..a01abdd2d3ea 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -243,7 +243,9 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
243 /* don't get messages out of order, and no recursion */ 243 /* don't get messages out of order, and no recursion */
244 if (skb_queue_len(&npinfo->txq) == 0 && 244 if (skb_queue_len(&npinfo->txq) == 0 &&
245 npinfo->poll_owner != smp_processor_id()) { 245 npinfo->poll_owner != smp_processor_id()) {
246 local_bh_disable(); /* Where's netif_tx_trylock_bh()? */ 246 unsigned long flags;
247
248 local_irq_save(flags);
247 if (netif_tx_trylock(dev)) { 249 if (netif_tx_trylock(dev)) {
248 /* try until next clock tick */ 250 /* try until next clock tick */
249 for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; 251 for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
@@ -261,7 +263,7 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
261 } 263 }
262 netif_tx_unlock(dev); 264 netif_tx_unlock(dev);
263 } 265 }
264 local_bh_enable(); 266 local_irq_restore(flags);
265 } 267 }
266 268
267 if (status != NETDEV_TX_OK) { 269 if (status != NETDEV_TX_OK) {