Skip to content

Commit 3845d29

Browse files
Marc Zyngierbjorn-helgaas
authored andcommitted
PCI/MSI: Only use the generic MSI layer when domain is hierarchical
Since d8a1cb7 ("PCI/MSI: Let pci_msi_get_domain use struct device::msi_domain"), we use the MSI domain associated with the PCI device. But finding an MSI domain doesn't mean that the domain is implemented using the generic MSI domain API, and a number of MSI controllers are still using arch_setup_msi_irq() and arch_teardown_msi_irqs(). Check that the domain we just obtained is hierarchical. If it is, we can use the new generic MSI stuff. Otherwise we have to fall back to the old arch_setup_msi_irq() and arch_teardown_msi_irqs() interfaces. This avoids an oops in msi_domain_alloc_irqs() on systems with R-Car, Tegra, Armada 370, and probably other DesignWare-based host controllers. Fixes: d8a1cb7 ("PCI/MSI: Let pci_msi_get_domain use struct device::msi_domain") Reported-by: Phil Edworthy <phil.edworthy@renesas.com> Tested-by: Phil Edworthy <phil.edworthy@renesas.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> CC: stable@vger.kernel.org # v4.3+
1 parent 7c7a0e9 commit 3845d29

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pci/msi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int pci_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
5454
struct irq_domain *domain;
5555

5656
domain = pci_msi_get_domain(dev);
57-
if (domain)
57+
if (domain && irq_domain_is_hierarchy(domain))
5858
return pci_msi_domain_alloc_irqs(domain, dev, nvec, type);
5959

6060
return arch_setup_msi_irqs(dev, nvec, type);
@@ -65,7 +65,7 @@ static void pci_msi_teardown_msi_irqs(struct pci_dev *dev)
6565
struct irq_domain *domain;
6666

6767
domain = pci_msi_get_domain(dev);
68-
if (domain)
68+
if (domain && irq_domain_is_hierarchy(domain))
6969
pci_msi_domain_free_irqs(domain, dev);
7070
else
7171
arch_teardown_msi_irqs(dev);

0 commit comments

Comments
 (0)