Skip to contentSkip to conversation

Revert "ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync"

PATCH In review Peter Ujfalusi 2 participants 2 messages Oct 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync"

From: Peter Ujfalusi <[email protected]>

This reverts commit 08fc2a7448afc1660ec2f1b5c437fcd14155a7ee.

The reverted commit causes the following warnigs:
Runtime PM usage count underflow!

This is due to the fact that the pm_runtime_resume_and_get() is calling pm_runtime_put_noidle() in case of < 0 return value of pm_runtime_get_sync() which includes the -EACCES.
The change is wrong as -EACCES is returned in case of 'nested' get_sync() and it is a valid use of PM runtime.

Fixes 08fc2a7448af ("ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync")
---
 sound/soc/soc-component.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/soc-component.c +4 -2
index 659b9ade4158..e12f8244242b 100644
@@ -1213,9 +1213,11 @@ int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd,
 	int i;
 
 	for_each_rtd_components(rtd, i, component) {
-		int ret = pm_runtime_resume_and_get(component->dev);
-		if (ret < 0 && ret != -EACCES)
+		int ret = pm_runtime_get_sync(component->dev);
+		if (ret < 0 && ret != -EACCES) {
+			pm_runtime_put_noidle(component->dev);
 			return soc_component_ret(component, ret);
+		}
 		/* mark stream if succeeded */
 		soc_component_mark_push(component, stream, pm);
 	}
Signature · 1 line
2.37.3
maintainer
#1 lore raw
Quoted 8 lines · Peter Ujfalusi

From: Peter Ujfalusi <[email protected]>

This reverts commit 08fc2a7448afc1660ec2f1b5c437fcd14155a7ee.

The reverted commit causes the following warnigs:
Runtime PM usage count underflow!

[...]

Applied to

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

Thanks!

[1/1] Revert "ASoC: soc-component: using pm_runtime_resume_and_get instead of pm_runtime_get_sync"

      commit: 0c72dbc96be870e4de8f9707c9a4c6d7a641381c

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