PCI/MSI: Allow msi_domain lookup using the host bridge node
authorMarc Zyngier <[email protected]>
Tue, 28 Jul 2015 13:46:13 +0000 (14:46 +0100)
committerThomas Gleixner <[email protected]>
Wed, 29 Jul 2015 22:14:37 +0000 (00:14 +0200)
A number of platforms do not need to use the msi-parent property,
as the host bridge itself provides the MSI controller.

Allow this configuration by performing an irq domain lookup based
on the host bridge node if it doesn't have a valid msi-parent property.

Acked-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
Cc: <[email protected]>
Cc: Yijing Wang <[email protected]>
Cc: Ma Jun <[email protected]>
Cc: Lorenzo Pieralisi <[email protected]>
Cc: Duc Dang <[email protected]>
Cc: Hanjun Guo <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: Jason Cooper <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
drivers/pci/of.c

index 85844d8c3efd5e5be16ce4842cf58e5c0d84016c..2e99a500cb83fe48ac065333fad036186935aa4f 100644 (file)
@@ -72,8 +72,13 @@ struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus)
 
        /* Start looking for a phandle to an MSI controller. */
        np = of_parse_phandle(bus->dev.of_node, "msi-parent", 0);
+
+       /*
+        * If we don't have an msi-parent property, look for a domain
+        * directly attached to the host bridge.
+        */
        if (!np)
-               return NULL;
+               np = bus->dev.of_node;
 
        d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
        if (d)