Commit f6bc2666 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4021cb27
...@@ -416,7 +416,9 @@ static void attach_msi_entry(struct msi_desc *entry, int vector) ...@@ -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) 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) if (cap_id == PCI_CAP_ID_MSIX)
irq_desc[pos].handler = &msix_irq_type; irq_desc[pos].handler = &msix_irq_type;
else { else {
...@@ -425,7 +427,7 @@ static void irq_handler_init(int cap_id, int pos, int mask) ...@@ -425,7 +427,7 @@ static void irq_handler_init(int cap_id, int pos, int mask)
else else
irq_desc[pos].handler = &msi_irq_w_maskbit_type; 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) static void enable_msi_mode(struct pci_dev *dev, int pos, int type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment