Re: [PATCH] irqchip/gic: Convert to handle_strict_flow_irq()
From: Valentin Schneider
Date: Mon Aug 16 2021 - 20:30:49 EST
On 15/08/21 07:54, Marc Zyngier wrote:
> This is going and-up in a wack-a-mole game. There is probably a bunch
> of these all over the place. I'd rather squash it at the root,
> i.e. with something like this (untested):
>
> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> index 099bc7e13d1b..601ad3fc47cd 100644
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -410,7 +410,12 @@ void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu)
>
> void ack_irq(struct irq_desc *desc)
> {
> - desc->irq_data.chip->irq_ack(&desc->irq_data);
> + struct irq_data *data = &desc->irq_data;
> +
> + while (!data->chip->irq_ack)
> + data = data->parent_data;
> +
> + data->chip->irq_ack(&desc->irq_data);
>
> if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW)
> irq_state_set_flow_masked(desc);
>
> We probably need something similar for irq_eoi().
>
> This however shows a more fundamental problem, I'm afraid. We set
> IRQCHIP_AUTOMASKS_FLOW in the GIC drivers (i.e. at the root), but test
> for it at the top of the hierarchy. As soon as we have more than a
> single layer of irqchip, this will do the wrong thing (or at least
> miss the masking optimisation).
>
Yup.
> This probably advocates for moving the flag into the descriptor. This
> really makes sense, as the flow is global to the whole stack, not just
> to the localised irqchip.
>
Are we guaranteed to have
.irq_ack \in {NULL, irq_chip_ack_parent}
for all intermediate (!root) irqchips? I don't see why that wouldn't be the
case, and with that in mind what you described makes sense to me.
> In order to restore -next into a working state, I'm temporarily
> dropping this series. Hopefully, we can sort this out before the merge
> window and reinstate it.
>
I'm away from any keyboard for most of this week, but I'll get to it by the
weekend.
> Thanks,
>
> M.
>
> --
> Without deviation from the norm, progress is not possible.