Skip to contentSkip to conversation

ASoC: SDCA: Power management fixes for the class function driver

PATCH In review Maciej Strozek 3 participants 5 messages Sep 24

Subsystems (3)
lore
Share & tools
lore

Maciej Strozek

author maintainer
#0 lore raw

cover ASoC: SDCA: Power management fixes for the class function driver

The first corrects the point at which the suspended flag is set during system suspend, the second balances the runtime PM reference taken in probe when one of the later probe steps fails.

Maciej Strozek (2):
ASoC: SDCA: Set suspended flag after resuming within system suspend
ASoC: SDCA: Add better pm_runtime error handling in func probe

 sound/soc/sdca/sdca_class_function.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

base-commit: 782424a17d77ae6de07b490618b523066c528f59

Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH 1/2 ASoC: SDCA: Set suspended flag after resuming within system suspend

drv->suspended path was executed before system suspension instead of after, move it lower to correct it.

Fixes 7a5214f769c7 ("ASoC: SDCA: Add basic system suspend support")
---
 sound/soc/sdca/sdca_class_function.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sdca/sdca_class_function.c +2 -2
index 1d7fd66038829..1a7167aafa910 100644
@@ -491,8 +491,6 @@ static int class_function_suspend(struct device *dev)
 	struct class_function_drv *drv = auxiliary_get_drvdata(auxdev);
 	int ret;
 
-	drv->suspended = true;
-
 	/* Ensure runtime resume runs on resume */
 	ret = pm_runtime_resume_and_get(dev);
 	if (ret) {
@@ -500,6 +498,8 @@ static int class_function_suspend(struct device *dev)
 		return ret;
 	}
 
+	drv->suspended = true;
+
 	sdca_irq_disable(drv->function, drv->core->irq_info);
 
 	ret = pm_runtime_force_suspend(dev);
Signature · 1 line
2.47.3
author maintainer
#2 lore raw

PATCH 2/2 ASoC: SDCA: Add better pm_runtime error handling in func probe

In reply to Maciej Strozek

Add a common error path in probe that balances the runtime PM reference.

Fixes 3af1815a2f9c ("ASoC: SDCA: Add basic SDCA function driver")
---
 sound/soc/sdca/sdca_class_function.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
sound/soc/sdca/sdca_class_function.c +11 -4
index 1a7167aafa910..bbc825e05e37a 100644
@@ -389,20 +389,27 @@ static int class_function_probe(struct auxiliary_device *auxdev,
 
 	ret = devm_pm_runtime_enable(dev);
 	if (ret)
-		return ret;
+		goto err_pm;
 
 	ret = class_function_boot(drv);
 	if (ret)
-		return ret;
+		goto err_pm;
 
 	ret = devm_snd_soc_register_component(dev, cmp_drv, dais, num_dais);
-	if (ret)
-		return dev_err_probe(dev, ret, "failed to register component\n");
+	if (ret) {
+		dev_err_probe(dev, ret, "failed to register component\n");
+		goto err_pm;
+	}
 
 	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
 
 	return 0;
+
+err_pm:
+	pm_runtime_put_sync(dev);
+
+	return ret;
 }
 
 static void class_function_remove(struct auxiliary_device *auxdev)
Signature · 1 line
2.47.3
maintainer Reviewed-by on the v1 series
#3 lore raw
In reply to Maciej Strozek
Quoted 8 lines · Maciej Strozek

The first corrects the point at which the suspended flag is set during system suspend, the second balances the runtime PM reference taken in probe when one of the later probe steps fails.

Maciej Strozek (2):
ASoC: SDCA: Set suspended flag after resuming within system suspend
ASoC: SDCA: Add better pm_runtime error handling in func probe

Quoted 6 lines
 sound/soc/sdca/sdca_class_function.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

base-commit: 782424a17d77ae6de07b490618b523066c528f59

Thanks,
Charles

maintainer
#4 lore raw
In reply to Maciej Strozek
Quoted 11 lines · Maciej Strozek

ASoC: SDCA: Power management fixes for the class function driver

The first corrects the point at which the suspended flag is set during system suspend, the second balances the runtime PM reference taken in probe when one of the later probe steps fails.

Maciej Strozek (2):
ASoC: SDCA: Set suspended flag after resuming within system suspend
ASoC: SDCA: Add better pm_runtime error handling in func probe

[...]

Applied to

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

Thanks!

[1/2] ASoC: SDCA: Set suspended flag after resuming within system suspend

      https://git.kernel.org/broonie/sound/c/b16610e3770e
[2/2] ASoC: SDCA: Add better pm_runtime error handling in func probe
      https://git.kernel.org/broonie/sound/c/91094f9c8621

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