Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/gic-v3-its: Add IORT hook for platform MSI support

Getting hold of the DevID requires us to call iort_pmsi_get_dev_id().
Since iort_pmsi_get_dev_id() may or may not be implemented, we
provide a weak function that acts as a stub.

The weak function will be removed when the ACPI counterpart is
merged.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

+9 -1
+9 -1
drivers/irqchip/irq-gic-v3-its-platform-msi.c
··· 48 48 return ret; 49 49 } 50 50 51 + int __weak iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id) 52 + { 53 + return -1; 54 + } 55 + 51 56 static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev, 52 57 int nvec, msi_alloc_info_t *info) 53 58 { ··· 62 57 63 58 msi_info = msi_get_domain_info(domain->parent); 64 59 65 - ret = of_pmsi_get_dev_id(domain, dev, &dev_id); 60 + if (dev->of_node) 61 + ret = of_pmsi_get_dev_id(domain, dev, &dev_id); 62 + else 63 + ret = iort_pmsi_get_dev_id(dev, &dev_id); 66 64 if (ret) 67 65 return ret; 68 66