]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
MIPS: loongson64: Override arch_dynirq_lower_bound to reserve LPC IRQs
authorIcenowy Zheng <zhengxingda@iscas.ac.cn>
Sat, 21 Mar 2026 09:20:27 +0000 (17:20 +0800)
committerThomas Gleixner <tglx@kernel.org>
Thu, 26 Mar 2026 15:15:02 +0000 (16:15 +0100)
On some Loongson 3A devices, a LPC bus is present and some legacy devices
(e.g. 8259) on it expect hardcoded low interrupt numbers. However currently
the expected low range interrupt numbers are not exempted from the dynamic
allocation, which leads to conflicts when registering LPC interrupts in the
fixed range.

Override arch_dynirq_lower_bound() to reserve these low range interrupt
numbers and prevent them from being dynamically allocated.

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Link: https://patch.msgid.link/20260321092032.3502701-2-zhengxingda@iscas.ac.cn
arch/mips/loongson64/init.c

index 5f73f8663ab2d903422ad4615b436b9a2a00b7a5..c7cc5a3d7817f1f297b3857b86dac89023aceed0 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/irqchip.h>
 #include <linux/logic_pio.h>
 #include <linux/memblock.h>
+#include <linux/minmax.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <asm/bootinfo.h>
@@ -227,3 +228,8 @@ void __init arch_init_irq(void)
        reserve_pio_range();
        irqchip_init();
 }
+
+unsigned int arch_dynirq_lower_bound(unsigned int from)
+{
+       return MAX(from, NR_IRQS_LEGACY);
+}