Skip to content

Commit

Permalink
PCI/MSI: Remove bogus warning in pci_irq_get_affinity()
Browse files Browse the repository at this point in the history
The recent overhaul of pci_irq_get_affinity() introduced a regression when
pci_irq_get_affinity() is called for an MSI-X interrupt which was not
allocated with affinity descriptor information.

The original code just returned a NULL pointer in that case, but the rework
added a WARN_ON() under the assumption that the corresponding WARN_ON() in
the MSI case can be applied to MSI-X as well.

In fact the MSI warning in the original code does not make sense either
because it's legitimate to invoke pci_irq_get_affinity() for a MSI
interrupt which was not allocated with affinity descriptor information.

Remove it and just return NULL as the original code did.

Fixes: f482359 ("PCI/MSI: Simplify pci_irq_get_affinity()")
Reported-by: Guenter Roeck <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/87ee4n38sm.ffs@tglx
  • Loading branch information
KAGA-KOKO committed Feb 4, 2022
1 parent 26291c5 commit dd7f5a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/pci/msi/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,8 @@ const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr)
if (!desc)
return cpu_possible_mask;

if (WARN_ON_ONCE(!desc->affinity))
/* MSI[X] interrupts can be allocated without affinity descriptor */
if (!desc->affinity)
return NULL;

/*
Expand Down

0 comments on commit dd7f5a1

Please sign in to comment.