Re: [PATCH v2 1/4] genirq: Walk the irq_data hierarchy when resending an interrupt
From: Valentin Schneider
Date: Fri Sep 04 2020 - 15:28:51 EST
Hi Marc,
On 03/09/20 19:32, Marc Zyngier wrote:
> On resending an interrupt, we only check the topmost irqchip for
> a irq_retrigger callback. However, this callback could be implemented
> at a lower level. Use irq_chip_retrigger_hierarchy() in this case.
>
Rookie wording question here; re-reading this I'm questioning which way is
up.
>From an irq_data hierarchy PoV, the topmost chip (i.e. last ->parent)
should be the root irqchip. However, the irq_desc we get from irq_to_desc()
ought to hold the irq_data for the lowermost irqchip in that irq_data
hierarchy.
Is it that here by "topmost" you instead mean topmost of the irqchip stack
on top of the root (IOW furthest away from the root)?
> Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
> ---
> kernel/irq/resend.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
> index c48ce19a257f..8ccd32a0cc80 100644
> --- a/kernel/irq/resend.c
> +++ b/kernel/irq/resend.c
> @@ -86,6 +86,18 @@ static int irq_sw_resend(struct irq_desc *desc)
> }
> #endif
>
> +static int try_retrigger(struct irq_desc *desc)
> +{
> + if (desc->irq_data.chip->irq_retrigger)
> + return desc->irq_data.chip->irq_retrigger(&desc->irq_data);
> +
> +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
> + return irq_chip_retrigger_hierarchy(&desc->irq_data);
> +#else
> + return 0;
> +#endif
> +}
> +
> /*
> * IRQ resend
> *
> @@ -113,8 +125,7 @@ int check_irq_resend(struct irq_desc *desc, bool inject)
>
> desc->istate &= ~IRQS_PENDING;
>
> - if (!desc->irq_data.chip->irq_retrigger ||
> - !desc->irq_data.chip->irq_retrigger(&desc->irq_data))
> + if (!try_retrigger(desc))
> err = irq_sw_resend(desc);
>
> /* If the retrigger was successfull, mark it with the REPLAY bit */