diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-06-05 19:15:41 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-06-05 19:15:41 +0200 |
commit | 06886e8043877d5c439f5e2a3bcf23761bc1ae9d (patch) | |
tree | b0e0eb507d3b4d615395a2661879428af237915b /drivers/pci | |
parent | Merge branch 'pci/shane-amd-ahci-i2c' into next (diff) | |
parent | x86/MSI: Conserve interrupt resources when using multiple-MSIs (diff) | |
download | linux-06886e8043877d5c439f5e2a3bcf23761bc1ae9d.tar.xz linux-06886e8043877d5c439f5e2a3bcf23761bc1ae9d.zip |
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.c | 10 |
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)); |