diff options
author | Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> | 2008-03-31 19:22:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-01 14:16:04 -0400 |
commit | cabce28ec0a0ae3d0ddfa4461f0e8be94ade9e46 (patch) | |
tree | d40f357c77bf99a33b9b81123b2c3149adf3717d /drivers/net | |
parent | a9edadbf790d72adf6ebed476cb5caf7743e7e4a (diff) |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/plip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/plip.c b/drivers/net/plip.c index fee3d7b1feba..1e965427b0e9 100644 --- a/drivers/net/plip.c +++ b/drivers/net/plip.c | |||
@@ -903,17 +903,18 @@ plip_interrupt(void *dev_id) | |||
903 | struct net_local *nl; | 903 | struct net_local *nl; |
904 | struct plip_local *rcv; | 904 | struct plip_local *rcv; |
905 | unsigned char c0; | 905 | unsigned char c0; |
906 | unsigned long flags; | ||
906 | 907 | ||
907 | nl = netdev_priv(dev); | 908 | nl = netdev_priv(dev); |
908 | rcv = &nl->rcv_data; | 909 | rcv = &nl->rcv_data; |
909 | 910 | ||
910 | spin_lock_irq (&nl->lock); | 911 | spin_lock_irqsave (&nl->lock, flags); |
911 | 912 | ||
912 | c0 = read_status(dev); | 913 | c0 = read_status(dev); |
913 | if ((c0 & 0xf8) != 0xc0) { | 914 | if ((c0 & 0xf8) != 0xc0) { |
914 | if ((dev->irq != -1) && (net_debug > 1)) | 915 | if ((dev->irq != -1) && (net_debug > 1)) |
915 | printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); | 916 | printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name); |
916 | spin_unlock_irq (&nl->lock); | 917 | spin_unlock_irqrestore (&nl->lock, flags); |
917 | return; | 918 | return; |
918 | } | 919 | } |
919 | 920 | ||
@@ -942,7 +943,7 @@ plip_interrupt(void *dev_id) | |||
942 | break; | 943 | break; |
943 | } | 944 | } |
944 | 945 | ||
945 | spin_unlock_irq(&nl->lock); | 946 | spin_unlock_irqrestore(&nl->lock, flags); |
946 | } | 947 | } |
947 | 948 | ||
948 | static int | 949 | static int |