|
@@ -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;
|