This is a note to let you know that I've just added the patch titled ASoC: SOF: sof-audio: setup sched widgets during pipeline complete step to the 5.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: asoc-sof-sof-audio-setup-sched-widgets-during-pipeline-complete-step.patch and it can be found in the queue-5.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 01429183f479c54c1b5d15453a8ce574ea43e525 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx> Date: Tue, 23 Nov 2021 19:16:04 +0200 Subject: ASoC: SOF: sof-audio: setup sched widgets during pipeline complete step From: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx> commit 01429183f479c54c1b5d15453a8ce574ea43e525 upstream. Older firmware prior to ABI 3.19 has a dependency where the scheduler widgets need to be setup last. Moving the call to sof_widget_setup() before the pipeline_complete() call also helps remove the need for the 'reverse' direction when walking through the widget list - this was only working because of the topology macros but the topology does not require any order. Fixes: 5fcdbb2d45df ("ASoC: SOF: Add support for dynamic pipelines") Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@xxxxxxxxxxxxxxx> Signed-off-by: Kai Vehmanen <kai.vehmanen@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20211123171606.129350-1-kai.vehmanen@xxxxxxxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/soc/sof/sof-audio.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -596,16 +596,25 @@ const struct sof_ipc_pipe_new *snd_sof_p int sof_set_up_pipelines(struct snd_sof_dev *sdev, bool verify) { + struct sof_ipc_fw_version *v = &sdev->fw_ready.version; struct snd_sof_widget *swidget; struct snd_sof_route *sroute; int ret; /* restore pipeline components */ - list_for_each_entry_reverse(swidget, &sdev->widget_list, list) { + list_for_each_entry(swidget, &sdev->widget_list, list) { /* only set up the widgets belonging to static pipelines */ if (!verify && swidget->dynamic_pipeline_widget) continue; + /* + * For older firmware, skip scheduler widgets in this loop, + * sof_widget_setup() will be called in the 'complete pipeline' loop + */ + if (v->abi_version < SOF_ABI_VER(3, 19, 0) && + swidget->id == snd_soc_dapm_scheduler) + continue; + /* update DAI config. The IPC will be sent in sof_widget_setup() */ if (WIDGET_IS_DAI(swidget->id)) { struct snd_sof_dai *dai = swidget->private; @@ -653,6 +662,12 @@ int sof_set_up_pipelines(struct snd_sof_ if (!verify && swidget->dynamic_pipeline_widget) continue; + if (v->abi_version < SOF_ABI_VER(3, 19, 0)) { + ret = sof_widget_setup(sdev, swidget); + if (ret < 0) + return ret; + } + swidget->complete = snd_sof_complete_pipeline(sdev, swidget); break; @@ -681,7 +696,7 @@ int sof_tear_down_pipelines(struct snd_s * sroute->setup because during suspend all streams are suspended and during topology * loading the sound card unavailable to open PCMs. */ - list_for_each_entry_reverse(swidget, &sdev->widget_list, list) { + list_for_each_entry(swidget, &sdev->widget_list, list) { if (swidget->dynamic_pipeline_widget) continue; Patches currently in stable-queue which might be from pierre-louis.bossart@xxxxxxxxxxxxxxx are queue-5.16/asoc-sof-sof-audio-setup-sched-widgets-during-pipeline-complete-step.patch queue-5.16/asoc-sof-intel-hda-add-quirks-for-hdaudio-dma-positi.patch queue-5.16/asoc-sof-free-widgets-in-sof_tear_down_pipelines-for-static-pipelines.patch queue-5.16/asoc-intel-sof_sdw-fix-jack-detection-on-hp-spectre-.patch queue-5.16/asoc-sof-handle-paused-streams-during-system-suspend.patch queue-5.16/asoc-sof-intel-fix-build-issue-related-to-codec_prob.patch queue-5.16/alsa-hda-make-proper-use-of-timecounter.patch queue-5.16/asoc-sof-ipc-add-null-pointer-check-for-substream-ru.patch queue-5.16/asoc-sof-topology-remove-sof_load_pipeline_ipc.patch