RE: [PATCH v4 8/8] irqchip/al-fic: add irq_set_affinity callback

From: Farber, Eliav

Date: Sun Oct 11 2026 - 01:01:52 EST


On Sat, Oct 10 2026 at 21:52, Thomas Gleixner wrote:
> On Thu, Oct 08 2026 at 09:00, Eliav Farber wrote:
>> The FIC aggregates up to 32 interrupt sources into a single parent GIC
>> SPI and has no per-child affinity control; affinity is determined by
>> the parent GIC SPI routing.
>>
>> irq_set_affinity() fails with -EINVAL when the target irqchip has no
>> irq_set_affinity callback, which prevents drivers that call it from
>> probing when their interrupt is routed through a FIC instance. Add an
>> irq_set_affinity callback that returns IRQ_SET_MASK_OK_DONE
>> unconditionally.
>>
>> Affinity requests cannot be forwarded to the parent GIC SPI, because
>> it may be shared by several FIC instances and changing its affinity
>> for one child would silently move all the others. A pr_warn_once() is
>> emitted when the requested affinity differs from the parent's current
>> affinity, giving visibility without failing the caller.
>
> No. That's a horrible hack and just pretends to solve a problem.
>
> We have the interrupt redirection infrastructure to handle that
> correctly. See fcc1d0dabd and subsequent commits.

Thanks, that's exactly what v5 uses. Dropped this patch and implemented
per-child affinity with irq_chip_redirect_set_affinity() and
generic_handle_demux_domain_irq(), with an irq_pre_redirect callback to
move the ack (and mask, for level-triggered groups) into parent context.
Tested on our hardware: a child pinned away from the parent SPI's CPU
runs on its target CPU with no re-fire storm.

Will send v5 shortly.

Thanks,
Eliav