Re: [PATCH] irqchip/gic-v3-its: Don't try to move a disabled irq

From: Thomas Gleixner
Date: Mon Jun 08 2020 - 19:36:41 EST


Ben,

Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> writes:
> On Mon, 2020-06-08 at 15:48 +0200, Thomas Gleixner wrote:
>> > if (cpu != its_dev->event_map.col_map[id]) {
>> > target_col = &its_dev->its->collections[cpu];
>> > - its_send_movi(its_dev, target_col, id);
>> > +
>> > + /* If the IRQ is disabled a discard was sent so don't move */
>> > + if (!irqd_irq_disabled(d))
>>
>> That check needs to be !irqd_is_activated() because enable_irq() does
>> not touch anything affinity related.
>
> Right. Note: other drivers (like arch/powerpc/sysdev/xive/common.c
> use irqd_is_started() ... this gets confusing :)

Blast from the past ...

arch/powerpc does not use hierarchical irq domains, so the activated
state does not matter there.


>> > + its_send_movi(its_dev, target_col, id);
>> > +
>> > its_dev->event_map.col_map[id] = cpu;
>> > irq_data_update_effective_affinity(d, cpumask_of(cpu));
>>
>> And then these associtations are disconnected from reality in any case.
>
> Not sure what you mean here, that said...

You skip the setup and then you set that state to look like it really
happened. How is that NOT disconnected from reality and a proper source
for undecodable failure later on beause something else subtly depends on
that state?

>> Something like the completely untested patch below should work.
>
> Ok. One possible issue though is before, the driver always had the
> opportunity to "vet" the affinity mask for whatever platform
> constraints may be there and change it before applying it. This is no
> longer the case on a deactivated interrupt with your patch as far as I
> can tell. I don't know if that is a problem and if drivers that do that
> have what it takes to "fixup" the affinity at startup time, the ones I
> wrote don't need that feature, but...

The driver still has the opportunity to do so when the interrupt is
acticated. And if you look at the conditions of that patch it carefully
applies this only to architectures which actually use hiearachical irq
domains. Everything else including good old PPC won't notice at all.

>> Thanks,
>>
>> tglx

<SNIP 60+ lines of useless information ....>

Can you please trim your replies?

Thanks,

tglx