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

From: Andrew Davis

Date: Thu Dec 03 2026 - 11:35:11 EST


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