Skip to content

Commit

Permalink
PCI/MSI: Don't warn when irq_create_affinity_masks() returns NULL
Browse files Browse the repository at this point in the history
irq_create_affinity_masks() can return NULL on non-SMP systems, when there
are not enough "free" vectors available to spread, or if memory allocation
for the CPU masks fails.  Only the allocation failure is of interest, and
even then the system will work just fine except for non-optimally spread
vectors.  Thus remove the warnings.

Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Acked-by: David S. Miller <[email protected]>
  • Loading branch information
Christoph Hellwig authored and bjorn-helgaas committed Aug 25, 2017
1 parent 8466489 commit 8e1101d
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,12 +538,9 @@ msi_setup_entry(struct pci_dev *dev, int nvec, const struct irq_affinity *affd)
struct msi_desc *entry;
u16 control;

if (affd) {
if (affd)
masks = irq_create_affinity_masks(nvec, affd);
if (!masks)
dev_err(&dev->dev, "can't allocate MSI affinity masks for %d vectors\n",
nvec);
}


/* MSI Entry Initialization */
entry = alloc_msi_entry(&dev->dev, nvec, masks);
Expand Down Expand Up @@ -679,12 +676,8 @@ static int msix_setup_entries(struct pci_dev *dev, void __iomem *base,
struct msi_desc *entry;
int ret, i;

if (affd) {
if (affd)
masks = irq_create_affinity_masks(nvec, affd);
if (!masks)
dev_err(&dev->dev, "can't allocate MSI-X affinity masks for %d vectors\n",
nvec);
}

for (i = 0, curmsk = masks; i < nvec; i++) {
entry = alloc_msi_entry(&dev->dev, 1, curmsk);
Expand Down

0 comments on commit 8e1101d

Please sign in to comment.