[PATCH v2 1/8] irqchip/imx-intmux: Don't create parent mappings while counting channels
From: Peng Fan
Date: Thu Dec 03 2026 - 04:29:42 EST
From: Peng Fan <peng.fan@xxxxxxx>
platform_irq_count() resolves every parent interrupt while counting the
channels. Resolving an interrupt creates a Linux IRQ mapping as a side
effect, so a probe failure before or during channel setup leaves
mappings behind for channels that were counted but never reached.
Count the interrupt entries with of_irq_count(), which does not create
mappings, and resolve each parent lazily with of_irq_get() in the channel
loop. of_irq_count() cannot return -EPROBE_DEFER, but of_irq_get() still
does when the parent interrupt domain is unavailable, so probe deferral
is preserved.
Fixes: 2fbb13961e74 ("irqchip: Add NXP INTMUX interrupt multiplexer support")
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
drivers/irqchip/irq-imx-intmux.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/irqchip/irq-imx-intmux.c b/drivers/irqchip/irq-imx-intmux.c
index 73926dec52ab..7552a3d0c369 100644
--- a/drivers/irqchip/irq-imx-intmux.c
+++ b/drivers/irqchip/irq-imx-intmux.c
@@ -204,10 +204,8 @@ static int imx_intmux_probe(struct platform_device *pdev)
int channum;
int i, ret;
- channum = platform_irq_count(pdev);
- if (channum == -EPROBE_DEFER) {
- return -EPROBE_DEFER;
- } else if (channum > CHAN_MAX_NUM) {
+ channum = of_irq_count(np);
+ if (channum > CHAN_MAX_NUM) {
dev_err(&pdev->dev, "supports up to %d multiplex channels\n",
CHAN_MAX_NUM);
return -EINVAL;
@@ -244,10 +242,12 @@ static int imx_intmux_probe(struct platform_device *pdev)
for (i = 0; i < channum; i++) {
data->irqchip_data[i].chanidx = i;
- data->irqchip_data[i].irq = irq_of_parse_and_map(np, i);
+ data->irqchip_data[i].irq = of_irq_get(np, i);
if (data->irqchip_data[i].irq <= 0) {
- ret = -EINVAL;
- dev_err(&pdev->dev, "failed to get irq\n");
+ ret = data->irqchip_data[i].irq;
+ if (!ret)
+ ret = -EINVAL;
+ dev_err_probe(&pdev->dev, ret, "failed to get irq\n");
goto out;
}
--
2.56.0