diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-26 01:42:11 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-31 11:30:18 -0800 |
commit | f6bc2666ed6696c40ef055e88ffef0b7657437a4 (patch) | |
tree | 30377687ad0cb9c9ef0141bf142511062e1980b5 | |
parent | 4021cb279a532728c3208a16b9b09b0ca8016850 (diff) | |
download | op-kernel-dev-f6bc2666ed6696c40ef055e88ffef0b7657437a4.zip op-kernel-dev-f6bc2666ed6696c40ef055e88ffef0b7657437a4.tar.gz |
[PATCH] fix deadlock in drivers/pci/msi.c
The lock validator caught another one: drivers/pci/msi.c is accessing
&irq_desc[i].lock with interrupts enabled (!).
The fix is to disable interrupts properly.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/pci/msi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 202b750..8e1ba0b 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -416,7 +416,9 @@ static void attach_msi_entry(struct msi_desc *entry, int vector) static void irq_handler_init(int cap_id, int pos, int mask) { - spin_lock(&irq_desc[pos].lock); + unsigned long flags; + + spin_lock_irqsave(&irq_desc[pos].lock, flags); if (cap_id == PCI_CAP_ID_MSIX) irq_desc[pos].handler = &msix_irq_type; else { @@ -425,7 +427,7 @@ static void irq_handler_init(int cap_id, int pos, int mask) else irq_desc[pos].handler = &msi_irq_w_maskbit_type; } - spin_unlock(&irq_desc[pos].lock); + spin_unlock_irqrestore(&irq_desc[pos].lock, flags); } static void enable_msi_mode(struct pci_dev *dev, int pos, int type) |