diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2017-07-02 18:48:49 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-07-02 18:48:49 -0500 |
commit | 6a1c1d553ebf4e4241c0b1e20517a67e36d46c12 (patch) | |
tree | 6001a40e5f461b86e8003f0ad7df55658951ee4d /drivers/pci | |
parent | 91bbec655f488b88281a2377b4e6c213d2d25978 (diff) | |
parent | 6f9a22bc5775d231ab8fbe2c2f3c88e45e3e7c28 (diff) |
Merge branch 'pci/msi' into next
* pci/msi:
PCI/MSI: Ignore affinity if pre/post vector count is more than min_vecs
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/msi.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index ba44fdfda66b..9e1569107cd6 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -1058,7 +1058,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec, for (;;) { if (affd) { - nvec = irq_calc_affinity_vectors(nvec, affd); + nvec = irq_calc_affinity_vectors(minvec, nvec, affd); if (nvec < minvec) return -ENOSPC; } @@ -1097,7 +1097,7 @@ static int __pci_enable_msix_range(struct pci_dev *dev, for (;;) { if (affd) { - nvec = irq_calc_affinity_vectors(nvec, affd); + nvec = irq_calc_affinity_vectors(minvec, nvec, affd); if (nvec < minvec) return -ENOSPC; } @@ -1165,16 +1165,6 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, if (flags & PCI_IRQ_AFFINITY) { if (!affd) affd = &msi_default_affd; - - if (affd->pre_vectors + affd->post_vectors > min_vecs) - return -EINVAL; - - /* - * If there aren't any vectors left after applying the pre/post - * vectors don't bother with assigning affinity. - */ - if (affd->pre_vectors + affd->post_vectors == min_vecs) - affd = NULL; } else { if (WARN_ON(affd)) affd = NULL; |