Make the ITS code aware of fsl_mc devices by plumbing the devid
retrieval primitive.

Reviewed-by: Ioana Ciornei <[email protected]>
Tested-by: Ioana Ciornei <[email protected]> # LX2160ARDB, LS2088ARDB
Tested-by: Sascha Bischoff <[email protected]>
Signed-off-by: Marc Zyngier <[email protected]>
---
 drivers/irqchip/irq-gic-its-msi-parent.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-gic-its-msi-parent.c 
b/drivers/irqchip/irq-gic-its-msi-parent.c
index a832cdb2e6978..d36b278ae66c5 100644
--- a/drivers/irqchip/irq-gic-its-msi-parent.c
+++ b/drivers/irqchip/irq-gic-its-msi-parent.c
@@ -5,6 +5,7 @@
 // Copyright (C) 2022 Intel
 
 #include <linux/acpi_iort.h>
+#include <linux/fsl/mc.h>
 #include <linux/of_address.h>
 #include <linux/pci.h>
 
@@ -187,9 +188,11 @@ static int its_pmsi_prepare(struct irq_domain *domain, 
struct device *dev,
 {
        struct msi_domain_info *msi_info;
        u32 dev_id;
-       int ret;
+       int ret = 0;
 
-       if (dev->of_node)
+       if (dev_is_fsl_mc(dev))
+               dev_id = fsl_mc_get_msi_id(dev);
+       else if (dev->of_node)
                ret = of_pmsi_get_msi_info(domain->parent, dev, &dev_id, NULL);
        else
                ret = iort_pmsi_get_msi_info(dev, &dev_id, NULL);
-- 
2.47.3


Reply via email to