Re: [PATCH v2 1/7] genirq: reserve NR_IRQS_LEGACY IRQs in dynirq by default

From: Thomas Gleixner

Date: Wed Feb 11 2026 - 06:53:08 EST


On Wed, Feb 11 2026 at 17:44, Icenowy Zheng wrote:
> Several architectures define NR_IRQS_LEGACY to reserve a low range of IRQ
> numbers for fixed legacy allocations (e.g. ISA interrupts) which should
> not be handed out by the dynamic IRQ allocator.
>
> arch_dynirq_lower_bound() exists to enforce this, but today only x86 wires
> it up. In the current boot order this typically works because legacy IRQ
> domains register early and claim the low IRQ numbers first; however, that
> assumption breaks if the legacy controller is probed later.
>
> Make the default arch_dynirq_lower_bound() implementation honour
> NR_IRQS_LEGACY by clamping the allocation start to at least that value.
>
> Architectures that do not define NR_IRQS_LEGACY keep the current behaviour
> (effectively 0). Arm/PowerPC/MIPS/LoongArch use legacy IRQ domains for ISA
> interrupts and benefit from this change. x86 and s390 already provide their
> own implementations.

Q: How do all those architectures which do not require the reservation
of the legacy interrupts benefit from that?

A: Not at all

- PowerPC has its own way to deal with that depending on the platform
the kernel runs on as not all platforms require it despite it being
defined.

- ARM only uses it when SPARSE_IRQ=n and does not need it
otherwise. So again this changes behaviour.

- MIPS is only using it for mips/longsoon64 and the rest of MIPS does not
care at all.

So if you need that on loonson, implement arch_dynirq_lower_bound()
instead of making uniformed claims.

Thanks,

tglx