diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-25 19:42:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-31 14:30:18 -0500 |
commit | f6bc2666ed6696c40ef055e88ffef0b7657437a4 (patch) | |
tree | 30377687ad0cb9c9ef0141bf142511062e1980b5 /drivers/pci | |
parent | 4021cb279a532728c3208a16b9b09b0ca8016850 (diff) |
[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>
Diffstat (limited to 'drivers/pci')
-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 202b7507a357..8e1ba0b7a8e4 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) | |||
416 | 416 | ||
417 | static void irq_handler_init(int cap_id, int pos, int mask) | 417 | static void irq_handler_init(int cap_id, int pos, int mask) |
418 | { | 418 | { |
419 | spin_lock(&irq_desc[pos].lock); | 419 | unsigned long flags; |
420 | |||
421 | spin_lock_irqsave(&irq_desc[pos].lock, flags); | ||
420 | if (cap_id == PCI_CAP_ID_MSIX) | 422 | if (cap_id == PCI_CAP_ID_MSIX) |
421 | irq_desc[pos].handler = &msix_irq_type; | 423 | irq_desc[pos].handler = &msix_irq_type; |
422 | else { | 424 | else { |
@@ -425,7 +427,7 @@ static void irq_handler_init(int cap_id, int pos, int mask) | |||
425 | else | 427 | else |
426 | irq_desc[pos].handler = &msi_irq_w_maskbit_type; | 428 | irq_desc[pos].handler = &msi_irq_w_maskbit_type; |
427 | } | 429 | } |
428 | spin_unlock(&irq_desc[pos].lock); | 430 | spin_unlock_irqrestore(&irq_desc[pos].lock, flags); |
429 | } | 431 | } |
430 | 432 | ||
431 | static void enable_msi_mode(struct pci_dev *dev, int pos, int type) | 433 | static void enable_msi_mode(struct pci_dev *dev, int pos, int type) |