All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe
@ 2022-09-27 14:25 Zhang Qilong
  2022-09-27 14:26 ` [PATCH v2 -next 1/2] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe Zhang Qilong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhang Qilong @ 2022-09-27 14:25 UTC (permalink / raw)
  To: olivier.moysan, arnaud.pouliquen, perex, tiwai, mcoquelin.stm32,
	lgirdwood, broonie
  Cc: alsa-devel, linux-stm32

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced. We fix it by moving pm_runtime_enable to the
endding of probe.
v2:
- Add reviewed-by

Zhang Qilong (2):
  ASoC: stm32: dfsdm: Fix PM disable depth imbalance in
    stm32_adfsdm_probe
  ASoC: stm32: spdifrx: Fix PM disable depth imbalance in
    stm32_spdifrx_probe

 sound/soc/stm/stm32_adfsdm.c  | 8 +++++---
 sound/soc/stm/stm32_spdifrx.c | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

-- 
2.25.1


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

* [PATCH v2 -next 1/2] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe
  2022-09-27 14:25 [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe Zhang Qilong
@ 2022-09-27 14:26 ` Zhang Qilong
  2022-09-27 14:26 ` [PATCH v2 -next 2/2] ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe Zhang Qilong
  2022-09-27 18:59 ` [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang Qilong @ 2022-09-27 14:26 UTC (permalink / raw)
  To: olivier.moysan, arnaud.pouliquen, perex, tiwai, mcoquelin.stm32,
	lgirdwood, broonie
  Cc: alsa-devel, linux-stm32

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of stm32_adfsdm_probe.

Fixes:98e500a12f934 ("ASoC: stm32: dfsdm: add pm_runtime support for audio")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 sound/soc/stm/stm32_adfsdm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index 04f2912e1418..643fc8a17018 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -335,8 +335,6 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
 
 	dev_set_drvdata(&pdev->dev, priv);
 
-	pm_runtime_enable(&pdev->dev);
-
 	ret = devm_snd_soc_register_component(&pdev->dev,
 					      &stm32_adfsdm_dai_component,
 					      &priv->dai_drv, 1);
@@ -366,9 +364,13 @@ static int stm32_adfsdm_probe(struct platform_device *pdev)
 #endif
 
 	ret = snd_soc_add_component(component, NULL, 0);
-	if (ret < 0)
+	if (ret < 0) {
 		dev_err(&pdev->dev, "%s: Failed to register PCM platform\n",
 			__func__);
+		return ret;
+	}
+
+	pm_runtime_enable(&pdev->dev);
 
 	return ret;
 }
-- 
2.25.1


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

* [PATCH v2 -next 2/2] ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe
  2022-09-27 14:25 [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe Zhang Qilong
  2022-09-27 14:26 ` [PATCH v2 -next 1/2] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe Zhang Qilong
@ 2022-09-27 14:26 ` Zhang Qilong
  2022-09-27 18:59 ` [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang Qilong @ 2022-09-27 14:26 UTC (permalink / raw)
  To: olivier.moysan, arnaud.pouliquen, perex, tiwai, mcoquelin.stm32,
	lgirdwood, broonie
  Cc: alsa-devel, linux-stm32

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context. We fix it by moving
pm_runtime_enable to the endding of stm32_spdifrx_probe.

Fixes:ac5e3efd55868 ("ASoC: stm32: spdifrx: add pm_runtime support")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
---
 sound/soc/stm/stm32_spdifrx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index 0f7146756717..d399c906bb92 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -1002,8 +1002,6 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
 	udelay(2);
 	reset_control_deassert(rst);
 
-	pm_runtime_enable(&pdev->dev);
-
 	pcm_config = &stm32_spdifrx_pcm_config;
 	ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, 0);
 	if (ret)
@@ -1036,6 +1034,8 @@ static int stm32_spdifrx_probe(struct platform_device *pdev)
 			FIELD_GET(SPDIFRX_VERR_MIN_MASK, ver));
 	}
 
+	pm_runtime_enable(&pdev->dev);
+
 	return ret;
 
 error:
-- 
2.25.1


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

* Re: [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe
  2022-09-27 14:25 [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe Zhang Qilong
  2022-09-27 14:26 ` [PATCH v2 -next 1/2] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe Zhang Qilong
  2022-09-27 14:26 ` [PATCH v2 -next 2/2] ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe Zhang Qilong
@ 2022-09-27 18:59 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-09-27 18:59 UTC (permalink / raw)
  To: arnaud.pouliquen, olivier.moysan, tiwai, perex, Zhang Qilong,
	mcoquelin.stm32, lgirdwood
  Cc: alsa-devel, linux-stm32

On Tue, 27 Sep 2022 22:25:59 +0800, Zhang Qilong wrote:
> The pm_runtime_enable will increase power disable depth. Thus
> a pairing decrement is needed on the error handling path to
> keep it balanced. We fix it by moving pm_runtime_enable to the
> endding of probe.
> v2:
> - Add reviewed-by
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe
      commit: b9a0da5b2edcae2a901b85c8cc42efc5bec4bd7b
[2/2] ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe
      commit: 0325cc0ac7980e1c7b744aab8df59afab6daeb43

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

end of thread, other threads:[~2022-09-27 19:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 14:25 [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe Zhang Qilong
2022-09-27 14:26 ` [PATCH v2 -next 1/2] ASoC: stm32: dfsdm: Fix PM disable depth imbalance in stm32_adfsdm_probe Zhang Qilong
2022-09-27 14:26 ` [PATCH v2 -next 2/2] ASoC: stm32: spdifrx: Fix PM disable depth imbalance in stm32_spdifrx_probe Zhang Qilong
2022-09-27 18:59 ` [PATCH v2 -next 0/2] Fix PM disable depth imbalance in stm32 probe Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.