Skip to content

Commit e2b5ccd

Browse files
committed
ASoC: SOF: ipc4-pcm: Workaround for firmware crash on stream stop
On stream stop there is one place where a firmware crash can break the state cleanup which will result broken runtime state and prevents further audio activities and the drivers must be removed and reloaded. We must not ignore errors from the DSP but if the DSP is in SOF_FW_CRASHED and the cmd is stop with reset state we should continue the execution on the kernel side. All subsequent IPCs will fail (not sent to DSP) but the kernel state will be torn down to a correct, expected state. Link: thesofproject/sof#8721 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent f39a3c2 commit e2b5ccd

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

sound/soc/sof/ipc4-pcm.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,19 @@ static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component,
413413
ret = sof_ipc4_set_multi_pipeline_state(sdev, state, trigger_list);
414414
if (ret < 0) {
415415
dev_err(sdev->dev, "failed to set final state %d for all pipelines\n", state);
416-
goto free;
416+
/*
417+
* workaround: if the firmware crashes during stop on pipeline
418+
* reset we must continue cleaning up the state by clearing the
419+
* return error code.
420+
* Since the firmware is crashed we will not send IPC messages
421+
* and we are going to see errors printed, but the state of the
422+
* widgets will be correct for the next boot.
423+
*/
424+
if (sdev->fw_state != SOF_FW_CRASHED ||
425+
!(cmd == SNDRV_PCM_TRIGGER_STOP && state == SOF_IPC4_PIPE_RESET))
426+
goto free;
427+
428+
ret = 0;
417429
}
418430

419431
/* update RUNNING/RESET state for all pipelines that were just triggered */

0 commit comments

Comments
 (0)