From: Peng Fan <peng.fan@linux.dev>
To: Thomas Gleixner <tglx@kernel.org>, Radu Rendec <radu@rendec.net>,
Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Shengjiu Wang <shengjiu.wang@nxp.com>,
Marc Zyngier <maz@kernel.org>
Cc: linux-kernel@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
Peng Fan <peng.fan@nxp.com>
Subject: [PATCH 2/8] irqchip/imx-intmux: Dispose IRQ mappings on remove
Date: Tue, 17 Nov 2026 15:14:06 +0800 [thread overview]
Message-ID: <20261117-imx-intmux-v1-2-189e7e0ad98d@nxp.com> (raw)
In-Reply-To: <20261117-imx-intmux-v1-0-189e7e0ad98d@nxp.com>
From: Peng Fan <peng.fan@nxp.com>
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@nxp.com>
---
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
next prev parent reply other threads:[~2026-11-17 7:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 7:14 [PATCH 0/8] irqchip/imx-intmux: Fix and modernize resource management Peng Fan
2026-11-17 7:14 ` [PATCH 1/8] irqchip/imx-intmux: Fix probe error path Peng Fan
2026-11-17 7:14 ` Peng Fan [this message]
2026-11-17 7:14 ` [PATCH 3/8] irqchip/imx-intmux: Handle platform_irq_count() errors Peng Fan
2026-11-17 7:14 ` [PATCH 4/8] irqchip/imx-intmux: Don't WARN on malformed interrupt specifiers Peng Fan
2026-11-17 7:14 ` [PATCH 5/8] irqchip/imx-intmux: Mark input interrupts as level-triggered Peng Fan
2026-11-17 7:14 ` [PATCH 6/8] irqchip/imx-intmux: Use devm_clk_get_enabled() Peng Fan
2026-11-17 7:14 ` [PATCH 7/8] irqchip/imx-intmux: Use devm_irq_domain_create_linear() Peng Fan
2026-11-17 7:14 ` [PATCH 8/8] irqchip/imx-intmux: Use devm_pm_runtime_set_active_enabled() Peng Fan
2026-11-17 13:27 ` [PATCH 0/8] irqchip/imx-intmux: Fix and modernize resource management Peng Fan
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=20261117-imx-intmux-v1-2-189e7e0ad98d@nxp.com \
--to=peng.fan@linux.dev \
--cc=Frank.Li@nxp.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=peng.fan@nxp.com \
--cc=radu@rendec.net \
--cc=s.hauer@pengutronix.de \
--cc=shengjiu.wang@nxp.com \
--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®