diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2022-11-25 00:26:16 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-12-05 22:22:33 +0100 |
commit | 8f986fd7755bec8b8c5776824afa1bd1151986d9 (patch) | |
tree | 1ab7feecf14a1dbfbc70ffa57ed4536b99d3f111 /kernel/irq | |
parent | efd42049657e958797a483f793e4064042faa49c (diff) |
genirq/msi: Provide msi_domain_ops:: Prepare_desc()
The existing MSI domain ops msi_prepare() and set_desc() turned out to be
unsuitable for implementing IMS support.
msi_prepare() does not operate on the MSI descriptors. set_desc() lacks
an irq_domain pointer and has a completely different purpose.
Introduce a prepare_desc() op which allows IMS implementations to amend an
MSI descriptor which was allocated by the core code, e.g. by adjusting the
iomem base or adding some data based on the allocated index. This is way
better than requiring that all IMS domain implementations preallocate the
MSI descriptor and then allocate the interrupt.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221124232326.444560717@linutronix.de
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/msi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c index 0749e661e459..6370ea53ff4a 100644 --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -1254,6 +1254,9 @@ static int __msi_domain_alloc_irqs(struct device *dev, struct irq_domain *domain if (WARN_ON_ONCE(allocated >= ctrl->nirqs)) return -EINVAL; + if (ops->prepare_desc) + ops->prepare_desc(domain, &arg, desc); + ops->set_desc(&arg, desc); virq = __irq_domain_alloc_irqs(domain, -1, desc->nvec_used, |