Re: [RFC PATCH] irqchip/gic-v3: wait irq done to set affinity

From: Thomas Gleixner
Date: Tue Jan 17 2023 - 04:41:27 EST


On Mon, Jan 09 2023 at 20:26, Yipeng Zou wrote:
> 在 2023/1/6 19:55, Marc Zyngier 写道:
> index 973ede0197e3..fad08ccb7fd9 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -1667,6 +1667,9 @@ static int its_set_affinity(struct irq_data *d,
> const struct cpumask *mask_val,
>
>         /* don't set the affinity when the target cpu is same as
> current one */
>         if (cpu != prev_cpu) {
> +
> +               // wait irq done on all cpus
> +

There is no way to wait here. The caller holds the interrupt descriptor
lock.

If this is really an issue for LPI, then the only way to deal with that
is CONFIG_GENERIC_PENDING_IRQ, which delays the affinity change to
interrupt context

Why on earth must all the known hardware mistakes be repeated over and
over?

Thanks,

tglx