summaryrefslogtreecommitdiffstats
path: root/drivers/pci/of.c
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe@linaro.org>2021-05-10 19:31:30 +0200
committerBjorn Helgaas <bhelgaas@google.com>2021-05-26 01:37:37 +0200
commit85aabbd7b315c65673084b6227bee92c00405239 (patch)
tree63b2c9b396ffd828691891afcc552163f46edfe9 /drivers/pci/of.c
parentMAINTAINERS: Add Krzysztof as PCI host/endpoint controllers reviewer (diff)
downloadlinux-85aabbd7b315c65673084b6227bee92c00405239.tar.xz
linux-85aabbd7b315c65673084b6227bee92c00405239.zip
PCI/MSI: Fix MSIs for generic hosts that use device-tree's "msi-map"
Since commit 9ec37efb8783 ("PCI/MSI: Make pci_host_common_probe() declare its reliance on MSI domains"), platforms that rely on the "msi-map" device-tree property don't get MSIs anymore. On the Arm Fast Model for example [1], the host bridge doesn't have a "msi-parent" property since it doesn't itself generate MSIs, and so doesn't get a MSI domain. It has an "msi-map" property instead to describe MSI controllers of child devices. As a result, due to the new msi_domain check in pci_register_host_bridge(), the whole bus gets PCI_BUS_FLAGS_NO_MSI. Check whether the root complex has an "msi-map" property before giving up on MSIs. [1] arch/arm64/boot/dts/arm/fvp-base-revc.dts Fixes: 9ec37efb8783 ("PCI/MSI: Make pci_host_common_probe() declare its reliance on MSI domains") Link: https://lore.kernel.org/r/20210510173129.750496-1-jean-philippe@linaro.org Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'drivers/pci/of.c')
-rw-r--r--drivers/pci/of.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index da5b414d585a..85dcb7097da4 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -103,6 +103,13 @@ struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus)
#endif
}
+bool pci_host_of_has_msi_map(struct device *dev)
+{
+ if (dev && dev->of_node)
+ return of_get_property(dev->of_node, "msi-map", NULL);
+ return false;
+}
+
static inline int __of_pci_pci_compare(struct device_node *node,
unsigned int data)
{