[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260131094547.455916-2-zhengxingda@iscas.ac.cn>
Date: Sat, 31 Jan 2026 17:45:40 +0800
From: Icenowy Zheng <zhengxingda@...as.ac.cn>
To: Thomas Gleixner <tglx@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Huacai Chen <chenhuacai@...nel.org>,
Jiaxun Yang <jiaxun.yang@...goat.com>
Cc: linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org,
linux-mips@...r.kernel.org,
Icenowy Zheng <zhengxingda@...as.ac.cn>,
linux-s390@...r.kernel.org,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>
Subject: [PATCH 1/8] genirq: reserve NR_IRQS_LEGACY IRQs in dynirq by default
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@...r.kernel.org
Cc: Heiko Carstens <hca@...ux.ibm.com>
Cc: Vasily Gorbik <gor@...ux.ibm.com>
Cc: Alexander Gordeev <agordeev@...ux.ibm.com>
Co-developed-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@...goat.com>
Signed-off-by: Icenowy Zheng <zhengxingda@...as.ac.cn>
---
If this change turns out to be problematic for any architecture, we can
always override arch_dynirq_lower_bound() for MIPS and LoongArch only.
BTW it looks that S390 has a arch_dynirq_lower_bound() override that has
the same behavior, but not with the same code. This is why S390
maintainers are Cc'ed by this patch.
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
Powered by blists - more mailing lists