Skip to content

Commit 8b65db1

Browse files
Lorenzo PieralisiMarc Zyngier
authored andcommitted
irqchip/msi-lib: Add IRQ_DOMAIN_FLAG_FWNODE_PARENT handling
In some irqchip implementations the fwnode representing the IRQdomain and the MSI controller fwnode do not match; in particular the IRQdomain fwnode is the MSI controller fwnode parent. To support selecting such IRQ domains, add a flag in core IRQ domain code that explicitly tells the MSI lib to use the parent fwnode while carrying out IRQ domain selection. Update the msi-lib select callback with the resulting logic. Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent b4ead12 commit 8b65db1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

drivers/irqchip/irq-msi-lib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,14 @@ int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec,
133133
{
134134
const struct msi_parent_ops *ops = d->msi_parent_ops;
135135
u32 busmask = BIT(bus_token);
136+
struct fwnode_handle *fwh;
136137

137138
if (!ops)
138139
return 0;
139140

140-
if (fwspec->fwnode != d->fwnode || fwspec->param_count != 0)
141+
fwh = d->flags & IRQ_DOMAIN_FLAG_FWNODE_PARENT ? fwnode_get_parent(fwspec->fwnode)
142+
: fwspec->fwnode;
143+
if (fwh != d->fwnode || fwspec->param_count != 0)
141144
return 0;
142145

143146
/* Handle pure domain searches */

include/linux/irqdomain.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ enum {
212212
/* Address and data pair is mutable when irq_set_affinity() */
213213
IRQ_DOMAIN_FLAG_MSI_IMMUTABLE = (1 << 11),
214214

215+
/* IRQ domain requires parent fwnode matching */
216+
IRQ_DOMAIN_FLAG_FWNODE_PARENT = (1 << 12),
217+
215218
/*
216219
* Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved
217220
* for implementation specific purposes and ignored by the

0 commit comments

Comments
 (0)