plip: replace spin_lock_irq with spin_lock_irqsave in irq context

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>

authored by Mikulas Patocka and committed by Linus Torvalds cabce28e a9edadbf

+4 -3
+4 -3
drivers/net/plip.c
··· 903 struct net_local *nl; 904 struct plip_local *rcv; 905 unsigned char c0; 906 907 nl = netdev_priv(dev); 908 rcv = &nl->rcv_data; 909 910 - spin_lock_irq (&nl->lock); 911 912 c0 = read_status(dev); 913 if ((c0 & 0xf8) != 0xc0) { 914 if ((dev->irq != -1) && (net_debug > 1)) 915 printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); 916 - spin_unlock_irq (&nl->lock); 917 return; 918 } 919 ··· 943 break; 944 } 945 946 - spin_unlock_irq(&nl->lock); 947 } 948 949 static int
··· 903 struct net_local *nl; 904 struct plip_local *rcv; 905 unsigned char c0; 906 + unsigned long flags; 907 908 nl = netdev_priv(dev); 909 rcv = &nl->rcv_data; 910 911 + spin_lock_irqsave (&nl->lock, flags); 912 913 c0 = read_status(dev); 914 if ((c0 & 0xf8) != 0xc0) { 915 if ((dev->irq != -1) && (net_debug > 1)) 916 printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); 917 + spin_unlock_irqrestore (&nl->lock, flags); 918 return; 919 } 920 ··· 942 break; 943 } 944 945 + spin_unlock_irqrestore(&nl->lock, flags); 946 } 947 948 static int