Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Davis <afd@ti.com>
To: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>, <tglx@kernel.org>,
	<nm@ti.com>, <kristo@kernel.org>, <ssantosh@kernel.org>,
	<hayashi.kunihiko@socionext.com>, <mhiramat@kernel.org>,
	<ioana.ciornei@nxp.com>, <alexander.stein@ew.tq-group.com>,
	<maz@kernel.org>, <lokeshvutla@ti.com>,
	<yamada.masahiro@socionext.com>, <robh@kernel.org>
Cc: <radu@rendec.net>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/3] irqchip/ti-sci-intr: Remove the interrupt domain on unbind
Date: Thu, 3 Dec 2026 10:32:09 -0600	[thread overview]
Message-ID: <48cd4ebb-ed92-4c67-9c1c-65a38ffe34e4@ti.com> (raw)
In-Reply-To: <20261128-f81b700d6c-u38-2@mail.sdu.edu.cn>

On 11/28/26 3:41 AM, Guangshuo Li wrote:
> The IRQ domain remains registered when the platform device releases
> the controller data used by its domain operations. Remove the
> domain as part of device teardown.
> 
> This issue was found by our static analysis tool under development.
> 
> Fixes: cd844b0715ce ("irqchip/ti-sci-intr: Add support for Interrupt Router driver")
> Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
> ---
>   drivers/irqchip/irq-ti-sci-intr.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/irqchip/irq-ti-sci-intr.c b/drivers/irqchip/irq-ti-sci-intr.c
> index 1d2e5af3ac4f..d504bb8865b3 100644
> --- a/drivers/irqchip/irq-ti-sci-intr.c
> +++ b/drivers/irqchip/irq-ti-sci-intr.c
> @@ -242,6 +242,11 @@ static const struct irq_domain_ops ti_sci_intr_irq_domain_ops = {
>   	.translate	= ti_sci_intr_irq_domain_translate,
>   };
>   
> +static void ti_sci_intr_remove_domain(void *data)
> +{
> +	irq_domain_remove(data);
> +}
> +
>   static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
>   {
>   	struct irq_domain *parent_domain, *domain;
> @@ -301,7 +306,7 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
>   
>   	dev_info(dev, "Interrupt Router %d domain created\n", intr->ti_sci_id);
>   
> -	return 0;
> +	return devm_add_action_or_reset(dev, ti_sci_intr_remove_domain, domain);

The domain is setup with `irq_domain_create_hierarchy()`, which is just a wrapper
around `irq_domain_instantiate()` which already has a devm_ version, maybe we
could use a devm_ version of the create hierarchy wrapper too.

Although `devm_irq_domain_instantiate()` probably causes the same issue that Radu
pointed out that it leads to most users not properly iterating through the mappings
to remove them first.

Andrew

>   }
>   
>   static const struct of_device_id ti_sci_intr_irq_domain_of_match[] = {
> 



  reply	other threads:[~2026-12-03 16:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  9:41 [PATCH 0/3] irqchip: Remove interrupt domains on driver teardown Guangshuo Li
2026-11-28  9:41 ` [PATCH 1/3] irqchip/ls-extirq: Remove the interrupt domain on unbind Guangshuo Li
2026-11-28  9:41 ` [PATCH 2/3] irqchip/ti-sci-intr: " Guangshuo Li
2026-12-03 16:32   ` Andrew Davis [this message]
2026-11-28  9:41 ` [PATCH 3/3] irqchip/uniphier-aidet: " Guangshuo Li
2026-11-28 21:36 ` [PATCH 0/3] irqchip: Remove interrupt domains on driver teardown Radu Rendec

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=48cd4ebb-ed92-4c67-9c1c-65a38ffe34e4@ti.com \
    --to=afd@ti.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=kristo@kernel.org \
    --cc=liguangshuo@mail.sdu.edu.cn \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    --cc=maz@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=nm@ti.com \
    --cc=radu@rendec.net \
    --cc=robh@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=tglx@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /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