Skip to content

Commit dd7f5a1

Browse files
committed
PCI/MSI: Remove bogus warning in pci_irq_get_affinity()
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
1 parent 26291c5 commit dd7f5a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/pci/msi/msi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,8 @@ const struct cpumask *pci_irq_get_affinity(struct pci_dev *dev, int nr)
11111111
if (!desc)
11121112
return cpu_possible_mask;
11131113

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

11171118
/*

0 commit comments

Comments
 (0)