mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergey Shtylyov <sergei.shtylyov@gmail.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
	Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] irqchip/gic-v3: Print a warning for out-of-range interrupt numbers
Date: Wed, 4 Mar 2026 20:05:24 +0300	[thread overview]
Message-ID: <535cfe49-4f70-4ed9-ae4f-92215140e6f6@gmail.com> (raw)
In-Reply-To: <62b849967d71d73e028fb65efee717986ef847e6.1772641758.git.geert+renesas@glider.be>

On 3/4/26 7:31 PM, Geert Uytterhoeven wrote:

> 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
> ---
>  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


  reply	other threads:[~2026-03-04 17:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 16:31 Geert Uytterhoeven
2026-03-04 17:05 ` Sergey Shtylyov [this message]
2026-03-04 17:13   ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535cfe49-4f70-4ed9-ae4f-92215140e6f6@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®