Skip to content

Commit 6f2a43e

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error rollback
If the ipc_prepare() callback fails for a module instance, on error rewind we must skip the ipc_unprepare() call for ones that has positive use count. The positive use count means that the module instance is in active use, it cannot be unprepared. The issue affects capture direction paths with branches (single dai with multiple PCMs), the affected widgets are in the shared part of the paths. Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Kai Vehmanen <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 37a2c94 commit 6f2a43e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/sof/sof-audio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
485485
if (ret < 0) {
486486
/* unprepare the source widget */
487487
if (widget_ops[widget->id].ipc_unprepare &&
488-
swidget && swidget->prepared) {
488+
swidget && swidget->prepared && swidget->use_count == 0) {
489489
widget_ops[widget->id].ipc_unprepare(swidget);
490490
swidget->prepared = false;
491491
}

0 commit comments

Comments
 (0)