* [PATCH] spi: imx: fix runtime pm leak on probe deferral
@ 2026-04-21 12:56 Johan Hovold
2026-04-22 3:32 ` Frank Li
2026-04-22 12:44 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-21 12:56 UTC (permalink / raw)
To: Mark Brown
Cc: Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
linux-spi, imx, linux-kernel, Johan Hovold, stable
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@vger.kernel.org # 5.10
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
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);
pm_runtime_set_suspended(&pdev->dev);
clk_disable_unprepare(spi_imx->clk_ipg);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] spi: imx: fix runtime pm leak on probe deferral
2026-04-21 12:56 [PATCH] spi: imx: fix runtime pm leak on probe deferral Johan Hovold
@ 2026-04-22 3:32 ` Frank Li
2026-04-22 6:47 ` Johan Hovold
2026-04-22 12:44 ` Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Frank Li @ 2026-04-22 3:32 UTC (permalink / raw)
To: Johan Hovold
Cc: Mark Brown, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
linux-spi, imx, linux-kernel, stable
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@vger.kernel.org # 5.10
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> 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
Frank
> pm_runtime_set_suspended(&pdev->dev);
>
> clk_disable_unprepare(spi_imx->clk_ipg);
> --
> 2.52.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] spi: imx: fix runtime pm leak on probe deferral
2026-04-22 3:32 ` Frank Li
@ 2026-04-22 6:47 ` Johan Hovold
2026-04-22 7:34 ` Frank Li
0 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2026-04-22 6:47 UTC (permalink / raw)
To: Frank Li
Cc: Mark Brown, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
linux-spi, imx, linux-kernel, stable
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@vger.kernel.org # 5.10
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > Signed-off-by: Johan Hovold <johan@kernel.org>
> > ---
> > 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.
Johan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] spi: imx: fix runtime pm leak on probe deferral
2026-04-22 6:47 ` Johan Hovold
@ 2026-04-22 7:34 ` Frank Li
0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-04-22 7:34 UTC (permalink / raw)
To: Johan Hovold
Cc: Mark Brown, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
linux-spi, imx, linux-kernel, stable
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@vger.kernel.org # 5.10
> > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > > Signed-off-by: Johan Hovold <johan@kernel.org>
> > > ---
> > > 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] spi: imx: fix runtime pm leak on probe deferral
2026-04-21 12:56 [PATCH] spi: imx: fix runtime pm leak on probe deferral Johan Hovold
2026-04-22 3:32 ` Frank Li
@ 2026-04-22 12:44 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-04-22 12:44 UTC (permalink / raw)
To: Johan Hovold
Cc: Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
linux-spi, imx, linux-kernel, stable
On Tue, 21 Apr 2026 14:56:32 +0200, Johan Hovold wrote:
> spi: imx: fix runtime pm leak on probe deferral
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.1
Thanks!
[1/1] spi: imx: fix runtime pm leak on probe deferral
https://git.kernel.org/broonie/spi/c/a1d50a37d3b1
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-22 19:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 12:56 [PATCH] spi: imx: fix runtime pm leak on probe deferral Johan Hovold
2026-04-22 3:32 ` Frank Li
2026-04-22 6:47 ` Johan Hovold
2026-04-22 7:34 ` Frank Li
2026-04-22 12:44 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox