plip: replace spin_lock_irq with spin_lock_irqsave in irq context
diff mbox series

Message ID
State New, archived
Headers show
  • plip: replace spin_lock_irq with spin_lock_irqsave in irq context
Related show

Commit Message

Mikulas Patocka March 31, 2008, 11:22 p.m. UTC

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.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

diff mbox series

--- linux-	2008-03-31 23:47:27.000000000 +0200
+++ linux-	2008-03-31 23:48:06.000000000 +0200
@@ -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);
@@ -942,7 +943,7 @@  plip_interrupt(void *dev_id)
-	spin_unlock_irq(&nl->lock);
+	spin_unlock_irqrestore(&nl->lock, flags);
 static int