Message ID | 87ed2a8ow5.ffs@tglx (mailing list archive) |
---|---|
State | Accepted |
Commit | a60b990798eb17433d0283788280422b1bd94b18 |
Headers | show |
Series | PCI/MSI: Handle lack of irqdomain gracefully | expand |
Hello: This patch was applied to riscv/linux.git (fixes) by Thomas Gleixner <tglx@linutronix.de>: On Sat, 14 Dec 2024 12:50:18 +0100 you wrote: > Alexandre observed a warning emitted from pci_msi_setup_msi_irqs() on a > RISCV platform which does not provide PCI/MSI support: > > WARNING: CPU: 1 PID: 1 at drivers/pci/msi/msi.h:121 pci_msi_setup_msi_irqs+0x2c/0x32 > __pci_enable_msix_range+0x30c/0x596 > pci_msi_setup_msi_irqs+0x2c/0x32 > pci_alloc_irq_vectors_affinity+0xb8/0xe2 > > [...] Here is the summary with links: - PCI/MSI: Handle lack of irqdomain gracefully https://git.kernel.org/riscv/c/a60b990798eb You are awesome, thank you!
--- a/drivers/pci/msi/irqdomain.c +++ b/drivers/pci/msi/irqdomain.c @@ -350,8 +350,11 @@ bool pci_msi_domain_supports(struct pci_ domain = dev_get_msi_domain(&pdev->dev); - if (!domain || !irq_domain_is_hierarchy(domain)) - return mode == ALLOW_LEGACY; + if (!domain || !irq_domain_is_hierarchy(domain)) { + if (IS_ENABLED(CONFIG_PCI_MSI_ARCH_FALLBACKS)) + return mode == ALLOW_LEGACY; + return false; + } if (!irq_domain_is_msi_parent(domain)) { /* --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -433,6 +433,10 @@ int __pci_enable_msi_range(struct pci_de if (WARN_ON_ONCE(dev->msi_enabled)) return -EINVAL; + /* Test for the availability of MSI support */ + if (!pci_msi_domain_supports(dev, 0, ALLOW_LEGACY)) + return -ENOTSUPP; + nvec = pci_msi_vec_count(dev); if (nvec < 0) return nvec;