Thread (3 messages) 3 messages, 3 authors, 2026-03-04

Re: [PATCH] irqchip/gic-v3: Print a warning for out-of-range interrupt numbers

From: Sergey Shtylyov <hidden>
Date: 2026-03-04 17:05:28
Also in: linux-renesas-soc, lkml

On 3/4/26 7:31 PM, Geert Uytterhoeven wrote:
quoted hunk ↗ jump to hunk
gic_irq_domain_translate() does not check if an interrupt number lies
within the valid range of the specified interrupt type.  Add these
checks, and print a warning if the interrupt number is out of range.

This can help flagging incorrectly described Extended SPI and PPI
interrupts in DT.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This would have prevented the issue fixed by "[PATCH] arm64: dts:
renesas: r8a78000: Fix out-of-range SPI interrupt numbers"[1].

[1] https://lore.kernel.org/1f9dd274720ea1b66617a5dd84f76c3efc829dc8.1772641415.git.geert+renesas@glider.be (local)
---
 drivers/irqchip/irq-gic-v3.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 20f13b686ab22faf..d75163e71bf22473 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1603,15 +1603,27 @@ static int gic_irq_domain_translate(struct irq_domain *d,
 
 		switch (fwspec->param[0]) {
 		case 0:			/* SPI */
+			if (fwspec->param[1] > 987)
+				pr_warn_once("SPI %u out of range (use ESPI?)\n",
+					     fwspec->param[1]);
 			*hwirq = fwspec->param[1] + 32;
 			break;
 		case 1:			/* PPI */
+			if (fwspec->param[1] > 16)
   Not 15? Don't PPIs use INTIDs 16-31?
+				pr_warn_once("PPI %u out of range (use EPPI?)\n",
+					     fwspec->param[1]);
 			*hwirq = fwspec->param[1] + 16;
 			break;
[...]

MBR, Sergey

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help