Skip to content

fixup! ASoC: SOF: pcm/pm: Fix WoV flow during system suspend / resume - #6063

Open
ujfalusi wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/woc-suspend-close
Open

ujfalusi wants to merge 1 commit into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/woc-suspend-close

Conversation

@ujfalusi

@ujfalusi ujfalusi commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator
Note for the squash: amend this to the "Fix WoV flow during system
suspend / resume" commit. Extend its commit message with:

  If the application closes the stream while it is still SUSPENDED, ALSA does
  not send STOP to it, the pipeline started_count is never decremented, the
  pipeline RESET is skipped in hw_free and the firmware is asked to unbind
  running pipelines, which makes the DSP panic.
  In sof_pcm_stream_free() clear suspend_ignored and replay what was missed,
  in the order of a regular STOP: RESUME and STOP the BEs via
  dpcm_be_dai_trigger() (the BEs are in DPCM SUSPEND state while their
  pipeline and link DMA is still running, the BE pipeline is skipped by the
  FE trigger), then STOP the FE pipelines.

@ujfalusi
ujfalusi requested review from bardliao and kv2019i and a balanced review from Copilot November 26, 2026 15:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical issues remain: retained backend pipelines can stay running with unbalanced counters, and STOP failure still permits unsafe RESET and teardown, risking firmware panic.

2 open issues
What changed in this PR

This fixup extends SOF’s Wake-on-Voice (WoV) suspend/resume handling to streams closed or re-prepared while suspended, aiming to prevent teardown of running firmware pipelines.

Changes:

  • Clear suspend_ignored and issue STOP for prepared streams before cleanup.
  • Log STOP failures and preserve the error for return after cleanup.
File Description
sound/​soc/​sof/​pcm.c Add STOP handling for suspend-retained WoV streams in sof_pcm_stream_free().

Review effort: Balanced

Comment thread sound/soc/sof/pcm.c Resolved
Comment thread sound/soc/sof/pcm.c
spcm_err(spcm, substream->stream,
"failed to stop the suspend ignored stream: %d\n",
ret);
err = ret;
@ujfalusi
ujfalusi marked this pull request as draft November 26, 2026 16:02
@ujfalusi
ujfalusi force-pushed the peter/sof/pr/woc-suspend-close branch from ce6ff84 to bce07ad Compare November 27, 2026 06:33
@ujfalusi
ujfalusi marked this pull request as ready for review November 27, 2026 06:34
Copilot AI balanced review requested due to automatic review settings November 27, 2026 06:34
Note for the squash: amend this to the "Fix WoV flow during system
suspend / resume" commit. Extend its commit message with:

  If the application closes the stream while it is still SUSPENDED, ALSA does
  not send STOP to it, the pipeline started_count is never decremented, the
  pipeline RESET is skipped in hw_free and the firmware is asked to unbind
  running pipelines, which makes the DSP panic.
  In sof_pcm_stream_free() clear suspend_ignored and replay what was missed,
  in the order of a regular STOP: RESUME and STOP the BEs via
  dpcm_be_dai_trigger() (the BEs are in DPCM SUSPEND state while their
  pipeline and link DMA is still running, the BE pipeline is skipped by the
  FE trigger), then STOP the FE pipelines.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Retained-BE cleanup can stop DMA still needed by another frontend or leave DMA running after prepare, requiring fixes to shared-user reference handling and retained-state cleanup.

3 open issues
1 resolved since last review

Review effort: Balanced

Comment thread sound/soc/sof/pcm.c
Comment on lines +237 to +239
ret = dpcm_be_dai_trigger(fe, dir, SNDRV_PCM_TRIGGER_RESUME);
if (!ret)
ret = dpcm_be_dai_trigger(fe, dir, SNDRV_PCM_TRIGGER_STOP);
Comment thread sound/soc/sof/pcm.c
Comment on lines +237 to +239
ret = dpcm_be_dai_trigger(fe, dir, SNDRV_PCM_TRIGGER_RESUME);
if (!ret)
ret = dpcm_be_dai_trigger(fe, dir, SNDRV_PCM_TRIGGER_STOP);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants