Re: [PATCH] spi: imx: fix runtime pm leak on probe deferral

From: Frank Li

Date: Wed Apr 22 2026 - 03:40:27 EST


On Wed, Apr 22, 2026 at 08:47:57AM +0200, Johan Hovold wrote:
> On Tue, Apr 21, 2026 at 11:32:48PM -0400, Frank Li wrote:
> > On Tue, Apr 21, 2026 at 02:56:32PM +0200, Johan Hovold wrote:
> > > Make sure to balance the runtime PM usage count before returning on
> > > probe failure (e.g. probe deferral) so that the controller can be
> > > suspended when a driver is later bound.
> > >
> > > Fixes: 43b6bf406cd0 ("spi: imx: fix runtime pm support for !CONFIG_PM")
> > > Cc: stable@xxxxxxxxxxxxxxx # 5.10
> > > Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> > > Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> > > ---
> > > drivers/spi/spi-imx.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
> > > index 4747899e0646..e5c907c45b87 100644
> > > --- a/drivers/spi/spi-imx.c
> > > +++ b/drivers/spi/spi-imx.c
> > > @@ -2373,6 +2373,7 @@ static int spi_imx_probe(struct platform_device *pdev)
> > > out_runtime_pm_put:
> > > pm_runtime_dont_use_autosuspend(spi_imx->dev);
> > > pm_runtime_disable(spi_imx->dev);
> > > + pm_runtime_put_noidle(spi_imx->dev);
> >
> > use devm_pm_runtime_get_noresume() and devm_pm_runtime_enable() to
> > fix this problem
>
> No. The first helper you mentioned was only added a year ago and does
> not even solve the issue without rewriting larger parts of the driver.
>
> So that would need to be a separate change in any case.

It should be less 10 line code changes. separate change is okay, but suggest
create following patches for this also.

Frank

>
> Johan