Skip to content

Commit

Permalink
irqchip/gic-v3: Make gic_irq_domain_select() robust for zero paramete…
Browse files Browse the repository at this point in the history
…r count

Currently the irqdomain select callback is only invoked when the parameter
count of the fwspec arguments is not zero. That makes sense because then
the match is on the firmware node and eventually on the bus_token, which is
already handled in the core code.

The upcoming support for per device MSI domains requires to do real bus
token specific checks in the MSI parent domains with a zero parameter
count.

Make the gic-v3 select() callback handle that case.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240127161753.114685-2-apatel@ventanamicro.com
  • Loading branch information
Thomas Gleixner committed Feb 15, 2024
1 parent 841c351 commit 1513782
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/irqchip/irq-gic-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1702,9 +1702,13 @@ static int gic_irq_domain_select(struct irq_domain *d,
irq_hw_number_t hwirq;

/* Not for us */
if (fwspec->fwnode != d->fwnode)
if (fwspec->fwnode != d->fwnode)
return 0;

/* Handle pure domain searches */
if (!fwspec->param_count)
return d->bus_token == bus_token;

/* If this is not DT, then we have a single domain */
if (!is_of_node(fwspec->fwnode))
return 1;
Expand Down

0 comments on commit 1513782

Please sign in to comment.