Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions sound/soc/sof/ipc4-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,19 @@ static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component,
ret = sof_ipc4_set_multi_pipeline_state(sdev, SOF_IPC4_PIPE_PAUSED, trigger_list);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to reset its internal state" ? in commit message

if (ret < 0) {
spcm_err(spcm, substream->stream, "failed to pause all pipelines\n");
goto free;
/*
* workaround: if the firmware is crashed or the IPC timed out
* while setting the pipeline state we must ignore the error
* code and proceed to set adjust the local pipeline states.
*
* If the firmware is crashed we will not send IPC messages
* and we are going to see errors printed, but the state of the
* widgets will be correct for the next boot.
*/
if (sdev->fw_state != SOF_FW_CRASHED && ret != -ETIMEDOUT)
goto free;

ret = 0;
}

/* update PAUSED state for all pipelines just triggered */
Expand Down Expand Up @@ -560,14 +572,15 @@ static int sof_ipc4_trigger_pipelines(struct snd_soc_component *component,
"failed to set final state %d for all pipelines\n",
state);
/*
* workaround: if the firmware is crashed while setting the
* pipelines to reset state we must ignore the error code and
* reset it to 0.
* Since the firmware is crashed we will not send IPC messages
* workaround: if the firmware is crashed or the IPC timed out
* while setting the pipeline state we must ignore the error
* code and proceed to set adjust the local pipeline states.
*
* If the firmware is crashed we will not send IPC messages
* and we are going to see errors printed, but the state of the
* widgets will be correct for the next boot.
*/
if (sdev->fw_state != SOF_FW_CRASHED || state != SOF_IPC4_PIPE_RESET)
if (sdev->fw_state != SOF_FW_CRASHED && ret != -ETIMEDOUT)
goto free;

ret = 0;
Expand Down