RE: [PATCH v5 3/9] irqchip/imx-irqsteer: Validate IRQ count before creating domain
From: Zhipeng Wang (OSS)
Date: Tue Aug 25 2026 - 23:28:00 EST
> Subject: Re: [PATCH v5 3/9] irqchip/imx-irqsteer: Validate IRQ count before
> creating domain
>
> Hi Zhipeng,
>
> On Mon, Aug 24, 2026 at 6:38 AM Zhipeng Wang (OSS)
> <zhipeng.wang_1@xxxxxxxxxxx> wrote:
>
> > Hi Frank,
> >
> > Makes sense, I'll restructure it that way for the next version:
> >
> > - Move Fabio's IRQ-count validation up so the count is validated before
> > the domain is created, and add proper error handling there.
> > - Since the invalid count is then rejected before the domain exists,
> > the domain leak can no longer happen, so managing the domain with
> > devm is no longer a fix. I'll drop its Fixes tag and reframe it as an
> > improvement.
> > - Move that devm conversion after the new
> devm_irq_domain_create_linear()
> > helper, together with the other cleanup.
>
> My motivation for sending [PATCH v4 1/2] irqchip/imx-irqsteer: Convert to
> devm_pm_runtime_enable()
> https://lore.kernel.org/lkml/aoXZf2z-50H8rimI@lizhi-Precision-Tower-5810/
> was the "Unbalanced pm_runtime_enable!"
> error during driver unbinding.
>
> This was seen on kernel 6.18, so I would like this error fixed in your series with
> a Fixes tag, so stable kernels like 6.18 can be fixed.
>
> Thanks
Agreed. For v6 I've pulled the "Unbalanced pm_runtime_enable!" fix out
into its own patch so it can be backported on its own:
irqchip/imx-irqsteer: Convert to devm_pm_runtime_set_active_enabled()
Fixes: 4730d2233311 ("irqchip/imx-irqsteer: Add runtime PM support")
It only touches runtime PM (no clock rework), so it applies cleanly to
6.18. It uses devm_pm_runtime_set_active_enabled() to disable runtime PM
on unbind, and keeps the
if (!pm_runtime_status_suspended(&pdev->dev))
clk_disable_unprepare(...);
guard in remove() so the clock reference count does not underflow when
the device is unbound while runtime-suspended, as in your patch.
The clock devres rework (devm_clk_get_enabled() etc.) is a separate
improvement patch later in the series, so it does not get in the way of
the stable backport.
Compared to v5, I also moved devm_pm_runtime_set_active_enabled() before
the IRQ domain is created, so its failure path just needs to bail out
instead of unwinding the domain and the parent IRQ mappings by hand.
This drops the err_irq label and keeps the patch minimal, matching your
original structure.
Thanks,
Zhipeng