[PATCH 2/3] irqchip/ti-sci-intr: Remove the interrupt domain on unbind

Andrew Davis afd at ti.com
Thu Dec 3 08:32:09 PST 2026


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 at 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[] = {
> 




More information about the linux-arm-kernel mailing list