Skip to content

ASoC/soundwire: SOF: keep WoV SoundWire paths active during suspend - #5968

Open
bardliao wants to merge 5 commits into
thesofproject:topic/sof-devfrom
bardliao:sdw-ignore-suspend
Open

bardliao wants to merge 5 commits into
thesofproject:topic/sof-devfrom
bardliao:sdw-ignore-suspend

Conversation

@bardliao

@bardliao bardliao commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Wake-on-voice requires the DSP audio path to remain available while the
system is suspended. Although SOF can keep a D0i3-compatible PCM running,
SoundWire stream and Intel controller suspend handling may still disable
the stream or its bus, while DAPM may power down widgets on the path.
This series propagates the ignore-suspend requirement from SOF to the
SoundWire stream and connected DAPM widgets and keep the required
components alive during system suspend.

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.

Copilot review overview

🟡 Changes recommended

Suspend-target handling, DAPM endpoint coverage, and ACE2.x teardown currently prevent safe path retention.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)
What changed in this PR

Adds suspend retention for D0i3-compatible SOF SoundWire audio paths.

Changes:

  • Propagates suspend retention through DAPM and SoundWire streams.
  • Keeps Intel SoundWire buses active during suspend.
  • Adjusts trigger handling for retained streams.
File Description
sound/​soc/​sof/​pcm.c Marks connected DAPM widgets for retention.
sound/​soc/​sof/​intel/​hda.c Propagates D0i3 compatibility to SoundWire.
sound/​soc/​sof/​intel/​hda-dai-ops.c Handles resume triggers.
sound/​soc/​sdw_utils/​soc_sdw_utils.c Preserves retained streams across suspend.
include/​linux/​soundwire/​sdw.h Adds retention state and bus API.
drivers/​soundwire/​stream.c Implements bus retention detection.
drivers/​soundwire/​intel.c Avoids suspending retained controller state.
drivers/​soundwire/​intel_auxdevice.c Skips bus power transitions when retained.
drivers/​soundwire/​intel_ace2x.c Applies retention to ACE2.x controllers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread drivers/soundwire/stream.c
Comment thread sound/soc/sof/intel/hda-dai-ops.c Outdated
Comment thread sound/soc/sof/intel/hda.c Outdated
Comment thread sound/soc/sof/pcm.c Outdated

@ujfalusi ujfalusi left a comment

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.

@bardliao, how about the codec drivers themself? I think that the one you use only marks the regcache cache only, but it would not be far fetched if a codec driver would actually do the right thing and powers down things in their PM suspend callback?

Comment thread sound/soc/sof/intel/hda-dai-ops.c Outdated
swidget->spipe->started_count = 0;
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_RESUME:

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.

with this patch: 8d544a0

you are not going to receive the RESUME trigger.

Comment thread sound/soc/sof/intel/hda.c Outdated
break;
}
if (!list_entry_is_head(spcm, &sdev->pcm_list, list) &&
spcm->stream[dir].d0i3_compatible)

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.

this will mark DeepBuffer playback and capture also, which is not correct.

The definition to use is:
9e47005

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@ujfalusi Do you mean just test spcm->stream[substream->stream].suspend_ignored?

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.

	 * WoV streams can be indetified by:
	 * They are capture streams and
	 * They have the d0i3_compatible flag set and
	 * They don't use Deep Buffer

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.

see this in #5951 :
8d544a0

Comment thread sound/soc/sof/intel/hda.c Outdated
Comment thread sound/soc/sof/pcm.c Outdated
return ret;
}

if (spcm->stream[dir].d0i3_compatible) {

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.

this will break deepbuffer playback and capture during suspend, the definition to use is:
9e47005

@bardliao

bardliao commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

@bardliao, how about the codec drivers themself? I think that the one you use only marks the regcache cache only, but it would not be far fetched if a codec driver would actually do the right thing and powers down things in their PM suspend callback?

Most SDW codec drivers don't do power down in their suspend callback. IOW the current solution applies to most codecs. We can handle the codecs that need to skip the device suspend in the future if needed.

@ujfalusi

ujfalusi commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

@bardliao, how about the codec drivers themself? I think that the one you use only marks the regcache cache only, but it would not be far fetched if a codec driver would actually do the right thing and powers down things in their PM suspend callback?

Most SDW codec drivers don't do power down in their suspend callback. IOW the current solution applies to most codecs. We can handle the codecs that need to skip the device suspend in the future if needed.

Operation whack-a-mole?

Some streams, such as those used for wake-on-voice, must remain active
during system suspend. Add an ignore_suspend flag to
sdw_stream_runtime and export sdw_bus_ignore_suspend() so bus drivers can
check whether any stream on the bus requires it to remain active.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Honor the SoundWire bus ignore-suspend state in the Intel drivers.
Preserve the master across system suspend when a stream requires the bus
to remain active.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Do not disable a SoundWire stream on suspend when it is marked to remain
active. If the stream is already enabled on resume, no further action is
needed.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Keep a SoundWire stream active during system suspend when it is used by
a WoV stream. WoV streams can be indetified by: They are capture streams
and. They have the d0i3_compatible flag set and They don't use Deep
Buffer.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 11:12
@bardliao
bardliao force-pushed the sdw-ignore-suspend branch from 0377bcf to d247a69 Compare October 7, 2026 11:12

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.

Copilot review overview

🟡 Changes recommended

Suspend policy is applied too broadly and required DAPM endpoints are omitted, potentially breaking wake-on-voice and deeper suspend states.

Review effort: Balanced
Findings: 6 Medium severity

Open (6)

Comment thread sound/soc/sof/intel/hda.c
Comment thread sound/soc/sof/pcm.c Outdated
@bardliao
bardliao force-pushed the sdw-ignore-suspend branch from d247a69 to 558587f Compare October 7, 2026 12:04
Copilot AI balanced review requested due to automatic review settings October 7, 2026 12:04

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.

Comment thread sound/soc/sof/pcm.c Outdated
Copilot AI balanced review requested due to automatic review settings October 7, 2026 14:38
@bardliao
bardliao force-pushed the sdw-ignore-suspend branch from 558587f to 9e0e7c2 Compare October 7, 2026 14:38

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.

Comment thread sound/soc/sof/pcm.c Outdated
The SOF DSP remains active for wake on voice streams, but DAPM may
still power down widgets on the PCM path. Mark the connected endpoint
widgets to ignore suspend so DAPM keeps the path powered.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao
bardliao force-pushed the sdw-ignore-suspend branch from 9e0e7c2 to 191e953 Compare October 8, 2026 07:54
Copilot AI balanced review requested due to automatic review settings October 8, 2026 07:54
@bardliao bardliao changed the title ASoC/soundwire: SOF: keep D0i3-compatible SoundWire paths active during suspend ASoC/soundwire: SOF: keep WoV SoundWire paths active during suspend Oct 8, 2026

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

Suspend-ignore state is applied too broadly and DAPM endpoint state is not preserved safely.

1 open finding
2 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread sound/soc/sof/pcm.c
dev_dbg(sdev->dev,
"WoV PCM %s ignore suspend for widget %s\n",
spcm->pcm.caps[dir].name, widget->name);
widget->ignore_suspend = ignore_suspend;
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.

3 participants