* [PATCH v2 1/7] genirq: reserve NR_IRQS_LEGACY IRQs in dynirq by default [not found] <20260211094408.3463916-1-zhengxingda@iscas.ac.cn> @ 2026-02-11 9:44 ` Icenowy Zheng 2026-02-11 11:51 ` Thomas Gleixner 0 siblings, 1 reply; 2+ messages in thread From: Icenowy Zheng @ 2026-02-11 9:44 UTC (permalink / raw) To: Thomas Gleixner, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang Cc: Yao Zi, linux-kernel, devicetree, linux-mips, Icenowy Zheng, linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev 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. Cc: linux-s390@vger.kernel.org Cc: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Co-developed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn> Tested-by: Yao Zi <me@ziyao.cc> --- kernel/softirq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/softirq.c b/kernel/softirq.c index 77198911b8dd4..cdc77d52c36b2 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -1184,5 +1184,5 @@ int __init __weak arch_early_irq_init(void) unsigned int __weak arch_dynirq_lower_bound(unsigned int from) { - return from; + return MAX(from, NR_IRQS_LEGACY); } -- 2.52.0 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 1/7] genirq: reserve NR_IRQS_LEGACY IRQs in dynirq by default 2026-02-11 9:44 ` [PATCH v2 1/7] genirq: reserve NR_IRQS_LEGACY IRQs in dynirq by default Icenowy Zheng @ 2026-02-11 11:51 ` Thomas Gleixner 0 siblings, 0 replies; 2+ messages in thread From: Thomas Gleixner @ 2026-02-11 11:51 UTC (permalink / raw) To: Icenowy Zheng, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Thomas Bogendoerfer, Huacai Chen, Jiaxun Yang Cc: Yao Zi, linux-kernel, devicetree, linux-mips, Icenowy Zheng, linux-s390, Heiko Carstens, Vasily Gorbik, Alexander Gordeev 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-11 11:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260211094408.3463916-1-zhengxingda@iscas.ac.cn>
2026-02-11 9:44 ` [PATCH v2 1/7] genirq: reserve NR_IRQS_LEGACY IRQs in dynirq by default Icenowy Zheng
2026-02-11 11:51 ` Thomas Gleixner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox