summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-06-05 21:15:41 +0400
committerBjorn Helgaas <bhelgaas@google.com>2013-06-05 21:15:41 +0400
commit06886e8043877d5c439f5e2a3bcf23761bc1ae9d (patch)
treeb0e0eb507d3b4d615395a2661879428af237915b /drivers/pci
parentb1267d60ce106be38a136b51a9edbf7c172b9dae (diff)
parent5fec945105448b958b8418b7e5d043d630ec3155 (diff)
downloadlinux-06886e8043877d5c439f5e2a3bcf23761bc1ae9d.tar.xz
Merge branch 'pci/alexander-msi' into next
* pci/alexander-msi: x86/MSI: Conserve interrupt resources when using multiple-MSIs PCI: Allocate only as many MSI vectors as requested by driver
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/msi.c10
1 files changed, 8 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)
int i, nvec;
if (entry->irq == 0)
continue;
- nvec = 1 << entry->msi_attrib.multiple;
+ if (entry->nvec_used)
+ nvec = entry->nvec_used;
+ else
+ nvec = 1 << entry->msi_attrib.multiple;
for (i = 0; i < nvec; i++)
arch_teardown_msi_irq(entry->irq + i);
}
@@ -336,7 +339,10 @@ static void free_msi_irqs(struct pci_dev *dev)
int i, nvec;
if (!entry->irq)
continue;
- nvec = 1 << entry->msi_attrib.multiple;
+ if (entry->nvec_used)
+ nvec = entry->nvec_used;
+ else
+ nvec = 1 << entry->msi_attrib.multiple;
#ifdef CONFIG_GENERIC_HARDIRQS
for (i = 0; i < nvec; i++)
BUG_ON(irq_has_action(entry->irq + i));