PCI/MSI: Simplify pci_irq_get_affinity()
Guenter Roeck
Tested-byQuoted 29 lines · Thomas Gleixner
Guenter,
Quoted 2 lines · Guenter Roeck
Sure. Please see http://server.roeck-us.net/qemu/x86/.
The logs are generated with with v5.16.4.thanks for providing the data. It definitely helped me to leave the state of not seeing the wood for the trees. Fix below.
Thanks,
tglx
---
Subject: PCI/MSI: Remove bogus warning inpci_irq_get_affinity()
From: Thomas Gleixner <[email protected]>
Date: Mon, 31 Jan 2022 22:02:46 +0100The recent overhaul of
pci_irq_get_affinity()introduced a regression whenpci_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 correspondingWARN_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.
Quoted 5 lines
Remove it and just return NULL as the original code did.
Fixes f48235900182 ("PCI/MSI: Simplify pci_irq_get_affinity()")Reported-by Guenter Roeck <[email protected]>Signed-off-by Thomas Gleixner <[email protected]>
Guenter
Quoted 16 lines
--- drivers/pci/msi/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/pci/msi/msi.c +2
-1@@ -1111,7 +1111,8 @@ const struct cpumask *pci_irq_get_affiniif (!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 ;/*