[PATCH v3 1/8] MIPS: Loongson64: Override arch_dynirq_lower_bound to reserve LPC IRQs

Icenowy Zheng posted 8 patches 3 weeks, 2 days ago
There is a newer version of this series
[PATCH v3 1/8] MIPS: Loongson64: Override arch_dynirq_lower_bound to reserve LPC IRQs
Posted by Icenowy Zheng 3 weeks, 2 days ago
On some Loongson 3A devices, a LPC bus is present and some legacy
devices (e.g. 8259) on it expect hardcoded low IRQ numbers. However
currently the expected low range IRQ numbers are not exempted from
the dynamic allocation, which leads to confliction when registering LPC
IRQs in the fixed range.

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

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
---
 arch/mips/loongson64/init.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/mips/loongson64/init.c b/arch/mips/loongson64/init.c
index 5f73f8663ab2d..c7cc5a3d7817f 100644
--- a/arch/mips/loongson64/init.c
+++ b/arch/mips/loongson64/init.c
@@ -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);
+}
-- 
2.52.0
Re: [PATCH v3 1/8] MIPS: Loongson64: Override arch_dynirq_lower_bound to reserve LPC IRQs
Posted by Thomas Gleixner 2 weeks, 3 days ago
On Sun, Mar 15 2026 at 00:28, Icenowy Zheng wrote:
> On some Loongson 3A devices, a LPC bus is present and some legacy
> devices (e.g. 8259) on it expect hardcoded low IRQ numbers. However

s/IRQ/interrupt/ all over the place

Change log are supposed to be written in proper prose and not be riddled
with acronyms unless the acronym has a technical relevance like LPC or
ACPI. IRQ[s] does not qualify for that.

Thanks,

     tglx