From nobody Fri Apr 10 01:02:03 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B40ED35FF66; Wed, 4 Mar 2026 16:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772641881; cv=none; b=NC3l47lDPbsdAnvjFClg14NDapmyvwXDII70qOBGEnUqnSlIT1ikG1F6857AGJR5hVxBtcmooXaC8wFThHSzE0uqcNG3OM73RE38KPHNv0SxsZ0JVHJvyqODxb1jev5etRLxv6HLcDB3v7Cn0bDoltNvdQqz2mOw59ejHRU9whE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772641881; c=relaxed/simple; bh=wg6dD9if9LqHGsnTHEWChL4qpDH/xts8LY8JazLgvWQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tl87fO60JH1xkKrRKQ3VhqoxKDdj0kC0FCaRpFCYuFC+HFRWuD8uxduJnb9oS3bHMsS8doZYY5d4g9jfYSy/0HIDB6r1ctPAOfXmWgj8vHAx3sd0EIY+zKEiqH69DB2Age56GbuGO01/zXYx70RAvgw8m3FRo6oImmr2E2P/b2c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A16DC4CEF7; Wed, 4 Mar 2026 16:31:19 +0000 (UTC) From: Geert Uytterhoeven To: Marc Zyngier , Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] irqchip/gic-v3: Print a warning for out-of-range interrupt numbers Date: Wed, 4 Mar 2026 17:31:14 +0100 Message-ID: <62b849967d71d73e028fb65efee717986ef847e6.1772641758.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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.177264= 1415.git.geert+renesas@glider.be --- 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_doma= in *d, =20 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 =3D fwspec->param[1] + 32; break; case 1: /* PPI */ + if (fwspec->param[1] > 16) + pr_warn_once("PPI %u out of range (use EPPI?)\n", + fwspec->param[1]); *hwirq =3D fwspec->param[1] + 16; break; case 2: /* ESPI */ + if (fwspec->param[1] > 1023) + pr_warn_once("ESPI %u out of range\n", + fwspec->param[1]); *hwirq =3D fwspec->param[1] + ESPI_BASE_INTID; break; case 3: /* EPPI */ + if (fwspec->param[1] > 63) + pr_warn_once("EPPI %u out of range\n", + fwspec->param[1]); *hwirq =3D fwspec->param[1] + EPPI_BASE_INTID; break; case GIC_IRQ_TYPE_LPI: /* LPI */ --=20 2.43.0