spi: imx: fix runtime pm leak on probe deferral
Subsystems (3)
PATCH 1/1 spi: imx: fix runtime pm leak on probe deferral
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.
--- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-imx.c +1 -0
@@ -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);
Signature · 1 line
2.52.0
Frank Li
maintainerQuoted 17 lines · Johan Hovold
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 [email protected] # 5.10Cc Sascha Hauer <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+)drivers/spi/spi-imx.c +0
-0
drivers/spi/spi-imx.c static int spi_imx_probe(struct platform_device *pdev) · line 2376
Quoted 4 lines
drivers/spi/spi-imx.c +1
-0@@ -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
Quoted 6 lines
drivers/spi/spi-imx.c +0
-1pm_runtime_set_suspended (&pdev->dev);clk_disable_unprepare (spi_imx->clk_ipg); --2.52.0
Quoted 13 lines · Frank Li
Quoted 12 lines · Johan Hovold
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 [email protected] # 5.10Cc Sascha Hauer <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+)
Quoted 12 lines
drivers/spi/spi-imx.c static int spi_imx_probe(struct platform_device *pdev) · line 2376
Quoted 9 lines
drivers/spi/spi-imx.c +1
-0@@ -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()anddevm_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
Frank Li
maintainerQuoted 27 lines · Johan Hovold
Quoted 13 lines · Frank Li
Quoted 12 lines · Johan Hovold
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 [email protected] # 5.10Cc Sascha Hauer <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/spi/spi-imx.c static int spi_imx_probe(struct platform_device *pdev) · line 2376
Quoted 9 lines
drivers/spi/spi-imx.c +1
-0@@ -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()anddevm_pm_runtime_enable()to fix this problem
Quoted 4 lines
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
Quoted 2 lines
Johan
Mark Brown
maintainerQuoted 1 line · Johan Hovold
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