diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2022-11-11 14:55:09 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-11-17 15:15:22 +0100 |
commit | d2a463b297415ca6dd4d60bb1c867dd7c931587b (patch) | |
tree | a6a2c0b1123cd0e5934f46a31c56301cef9134a2 /drivers/pci/msi/msi.h | |
parent | bab65e48cb064d67b488efb6888c06fd977a8245 (diff) | |
download | linux-stable-d2a463b297415ca6dd4d60bb1c867dd7c931587b.tar.gz linux-stable-d2a463b297415ca6dd4d60bb1c867dd7c931587b.tar.bz2 linux-stable-d2a463b297415ca6dd4d60bb1c867dd7c931587b.zip |
PCI/MSI: Reject multi-MSI early
When hierarchical MSI interrupt domains are enabled then there is no point
to do tons of work and detect the missing support for multi-MSI late in the
allocation path.
Just query the domain feature flags right away. The query function is going
to be used for other purposes later and has a mode argument which influences
the result:
ALLOW_LEGACY returns true when:
- there is no irq domain attached (legacy support)
- there is a irq domain attached which has the feature flag set
DENY_LEGACY returns only true when:
- there is a irq domain attached which has the feature flag set
This allows to use the function universally without ifdeffery in the
calling code.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20221111122015.574339988@linutronix.de
Diffstat (limited to 'drivers/pci/msi/msi.h')
-rw-r--r-- | drivers/pci/msi/msi.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/msi/msi.h b/drivers/pci/msi/msi.h index 8170ef2c5ad0..9d75b6fb3e0c 100644 --- a/drivers/pci/msi/msi.h +++ b/drivers/pci/msi/msi.h @@ -97,6 +97,15 @@ int __pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int void __pci_restore_msi_state(struct pci_dev *dev); void __pci_restore_msix_state(struct pci_dev *dev); +/* irq_domain related functionality */ + +enum support_mode { + ALLOW_LEGACY, + DENY_LEGACY, +}; + +bool pci_msi_domain_supports(struct pci_dev *dev, unsigned int feature_mask, enum support_mode mode); + /* Legacy (!IRQDOMAIN) fallbacks */ #ifdef CONFIG_PCI_MSI_ARCH_FALLBACKS |