linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: imx: fix the unbalanced spi runtime pm management
@ 2020-11-24  8:52 Clark Wang
  2020-11-24 15:37 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Clark Wang @ 2020-11-24  8:52 UTC (permalink / raw)
  To: broonie, shawnguo, s.hauer, nikita.shubin
  Cc: kernel, festevam, linux-imx, linux-spi, linux-arm-kernel, linux-kernel

If set active without increase the usage count of pm, the dont use
autosuspend function will call the suspend callback to close the two
clocks of spi because the usage count is reduced to -1.
This will cause the warning dump below when the defer-probe occurs.

[  129.379701] ecspi2_root_clk already disabled
[  129.384005] WARNING: CPU: 1 PID: 33 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0

So add the get noresume function before set active.

Fixes: 43b6bf406cd0 spi: imx: fix runtime pm support for !CONFIG_PM
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
---
 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 7513ef552d79..73ca821763d6 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1659,6 +1659,7 @@ static int spi_imx_probe(struct platform_device *pdev)
 
 	pm_runtime_set_autosuspend_delay(spi_imx->dev, MXC_RPM_TIMEOUT);
 	pm_runtime_use_autosuspend(spi_imx->dev);
+	pm_runtime_get_noresume(spi_imx->dev);
 	pm_runtime_set_active(spi_imx->dev);
 	pm_runtime_enable(spi_imx->dev);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: imx: fix the unbalanced spi runtime pm management
  2020-11-24  8:52 [PATCH] spi: imx: fix the unbalanced spi runtime pm management Clark Wang
@ 2020-11-24 15:37 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-11-24 15:37 UTC (permalink / raw)
  To: Clark Wang, nikita.shubin, shawnguo, s.hauer
  Cc: linux-kernel, linux-spi, linux-arm-kernel, linux-imx, kernel, festevam

On Tue, 24 Nov 2020 16:52:47 +0800, Clark Wang wrote:
> If set active without increase the usage count of pm, the dont use
> autosuspend function will call the suspend callback to close the two
> clocks of spi because the usage count is reduced to -1.
> This will cause the warning dump below when the defer-probe occurs.
> 
> [  129.379701] ecspi2_root_clk already disabled
> [  129.384005] WARNING: CPU: 1 PID: 33 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: imx: fix the unbalanced spi runtime pm management
      commit: 7cd71202961090d8f2d2b863ec66b25ae43e1d39

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] 2+ messages in thread

end of thread, other threads:[~2020-11-24 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24  8:52 [PATCH] spi: imx: fix the unbalanced spi runtime pm management Clark Wang
2020-11-24 15:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).