summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>2008-04-01 01:22:45 +0200
committerChris Wright <chrisw@sous-sol.org>2008-04-18 18:53:28 -0700
commitb895b7886c143e446b8b222a19f10cb0890faae6 (patch)
treed3707ce374cdc0bbbb5642bf39d1539fa08d9ed4
parent53def1fec24f8216778a0492e62370141c5c15a4 (diff)
plip: replace spin_lock_irq with spin_lock_irqsave in irq context
upstream commit: cabce28ec0a0ae3d0ddfa4461f0e8be94ade9e46 Plip uses spin_lock_irq/spin_unlock_irq in its IRQ handler (called from parport IRQ handler), the latter enables interrupts without parport subsystem IRQ handler expecting it. The bug can be seen if you compile kernel with lock dependency checking and use plip --- it produces a warning. This patch changes it to spin_lock_irqsave/spin_lock_irqrestore, so that it doesn't enable interrupts when already disabled. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r--drivers/net/plip.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index 57c98669984d..0f40c001e52f 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -903,17 +903,18 @@ plip_interrupt(void *dev_id)
struct net_local *nl;
struct plip_local *rcv;
unsigned char c0;
+ unsigned long flags;
nl = netdev_priv(dev);
rcv = &nl->rcv_data;
- spin_lock_irq (&nl->lock);
+ spin_lock_irqsave (&nl->lock, flags);
c0 = read_status(dev);
if ((c0 & 0xf8) != 0xc0) {
if ((dev->irq != -1) && (net_debug > 1))
printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name);
- spin_unlock_irq (&nl->lock);
+ spin_unlock_irqrestore (&nl->lock, flags);
return;
}
@@ -942,7 +943,7 @@ plip_interrupt(void *dev_id)
break;
}
- spin_unlock_irq(&nl->lock);
+ spin_unlock_irqrestore(&nl->lock, flags);
}
static int