Skip to content

Commit

Permalink
ASoC: SOF: sof-audio: Skip unprepare for in-use widgets on error roll…
Browse files Browse the repository at this point in the history
…back

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]>
  • Loading branch information
ujfalusi authored and plbossart committed May 30, 2024
1 parent f320bdb commit eabc34a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/sof/sof-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
if (ret < 0) {
/* unprepare the source widget */
if (widget_ops[widget->id].ipc_unprepare &&
swidget && swidget->prepared) {
swidget && swidget->prepared && swidget->use_count == 0) {
widget_ops[widget->id].ipc_unprepare(swidget);
swidget->prepared = false;
}
Expand Down

0 comments on commit eabc34a

Please sign in to comment.