aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/msi.c10
-rw-r--r--include/linux/msi.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 2c1075213bec..aca7578b05e5 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -81,7 +81,10 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
81 int i, nvec; 81 int i, nvec;
82 if (entry->irq == 0) 82 if (entry->irq == 0)
83 continue; 83 continue;
84 nvec = 1 << entry->msi_attrib.multiple; 84 if (entry->nvec_used)
85 nvec = entry->nvec_used;
86 else
87 nvec = 1 << entry->msi_attrib.multiple;
85 for (i = 0; i < nvec; i++) 88 for (i = 0; i < nvec; i++)
86 arch_teardown_msi_irq(entry->irq + i); 89 arch_teardown_msi_irq(entry->irq + i);
87 } 90 }
@@ -336,7 +339,10 @@ static void free_msi_irqs(struct pci_dev *dev)
336 int i, nvec; 339 int i, nvec;
337 if (!entry->irq) 340 if (!entry->irq)
338 continue; 341 continue;
339 nvec = 1 << entry->msi_attrib.multiple; 342 if (entry->nvec_used)
343 nvec = entry->nvec_used;
344 else
345 nvec = 1 << entry->msi_attrib.multiple;
340#ifdef CONFIG_GENERIC_HARDIRQS 346#ifdef CONFIG_GENERIC_HARDIRQS
341 for (i = 0; i < nvec; i++) 347 for (i = 0; i < nvec; i++)
342 BUG_ON(irq_has_action(entry->irq + i)); 348 BUG_ON(irq_has_action(entry->irq + i));
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 20c2d6dd5d25..ee66f3a12fb6 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -35,6 +35,7 @@ struct msi_desc {
35 35
36 u32 masked; /* mask bits */ 36 u32 masked; /* mask bits */
37 unsigned int irq; 37 unsigned int irq;
38 unsigned int nvec_used; /* number of messages */
38 struct list_head list; 39 struct list_head list;
39 40
40 union { 41 union {