aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/isa-skeleton.c
diff options
context:
space:
mode:
authorDongdong Deng <dongdong.deng@windriver.com>2009-07-12 16:27:06 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-14 15:03:41 -0400
commit79fbe134832ebb70a49d8802cfeb2401dc35bb38 (patch)
tree52e810d78f6357826b83963286b1fcd9d53bd882 /drivers/net/isa-skeleton.c
parentbc23283c7bc90958927abe26eedc562701743a88 (diff)
drivers/net: using spin_lock_irqsave() in net_send_packet()
spin_unlock_irq() will enable interrupt in net_send_packet(), this patch changes it to spin_lock_irqsave/spin_lock_irqrestore, so that it doesn't enable interrupts when already disabled, and netconsole would work properly over cs89x0/isa-skeleton. Call trace: netconsole write_msg() { ... -> spin_lock_irqsave(); -> netpoll_send_udp() -> netpoll_send_skb() -> net_send_packet() ->... -> spin_unlock_irqrestore(); ... } Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/isa-skeleton.c')
-rw-r--r--drivers/net/isa-skeleton.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c
index 73585fd8f29f..d12377b84358 100644
--- a/drivers/net/isa-skeleton.c
+++ b/drivers/net/isa-skeleton.c
@@ -430,7 +430,8 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
430 * hardware interrupt handler. Queue flow control is 430 * hardware interrupt handler. Queue flow control is
431 * thus managed under this lock as well. 431 * thus managed under this lock as well.
432 */ 432 */
433 spin_lock_irq(&np->lock); 433 unsigned long flags;
434 spin_lock_irqsave(&np->lock, flags);
434 435
435 add_to_tx_ring(np, skb, length); 436 add_to_tx_ring(np, skb, length);
436 dev->trans_start = jiffies; 437 dev->trans_start = jiffies;
@@ -446,7 +447,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
446 * is when the transmit statistics are updated. 447 * is when the transmit statistics are updated.
447 */ 448 */
448 449
449 spin_unlock_irq(&np->lock); 450 spin_unlock_irqrestore(&np->lock, flags);
450#else 451#else
451 /* This is the case for older hardware which takes 452 /* This is the case for older hardware which takes
452 * a single transmit buffer at a time, and it is 453 * a single transmit buffer at a time, and it is