[PATCH 2/8] irqchip/imx-intmux: Dispose IRQ mappings on remove

From: Peng Fan

Date: Tue Nov 17 2026 - 02:14:38 EST


From: Peng Fan <peng.fan@xxxxxxx>

The driver removes its IRQ domains without disposing the mappings
created for their 32 input lines, and it never releases the parent
IRQ mappings obtained with irq_of_parse_and_map(). Removing a domain
while mappings are still present leaves those descriptors pointing at
a freed domain, and the parent mappings leak on every unbind.

Unchain each output interrupt, dispose the child mappings and the
parent mapping, and only then remove the domain.

Fixes: 2fbb13961e74 ("irqchip: Add NXP INTMUX interrupt multiplexer support")
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
drivers/irqchip/irq-imx-intmux.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-imx-intmux.c b/drivers/irqchip/irq-imx-intmux.c
index a9eda7646e2f..644282228f1a 100644
--- a/drivers/irqchip/irq-imx-intmux.c
+++ b/drivers/irqchip/irq-imx-intmux.c
@@ -312,8 +312,11 @@ static void imx_intmux_remove(struct platform_device *pdev)
writel_relaxed(0, data->regs + CHANIER(i));
irq_set_chained_handler_and_data(data->irqchip_data[i].irq,
NULL, NULL);
-
+ for (unsigned int hwirq = 0; hwirq < 32; hwirq++)
+ irq_dispose_mapping(irq_find_mapping(data->irqchip_data[i].domain,
+ hwirq));
irq_domain_remove(data->irqchip_data[i].domain);
+ irq_dispose_mapping(data->irqchip_data[i].irq);
}

pm_runtime_disable(&pdev->dev);

--
2.56.0