[PATCH 0/2] ASoC: SOF: Fix IPC reliability and post-resume SoundWire init

Cole Leavitt posted 2 patches 1 month, 2 weeks ago
sound/soc/sof/intel/cnl.c            | 17 ++---------
sound/soc/sof/intel/hda-common-ops.c |  1 +
sound/soc/sof/intel/hda-ipc.c        | 17 ++---------
sound/soc/sof/intel/hda.c            | 44 ++++++++++++++++++++++++++++
sound/soc/sof/intel/hda.h            | 14 ++++-----
sound/soc/sof/intel/mtl.c            | 17 ++---------
sound/soc/sof/ipc4-topology.c        |  8 +++++
sound/soc/sof/ipc4.c                 | 17 +++++++++--
sound/soc/sof/sof-priv.h             |  3 ++
9 files changed, 83 insertions(+), 55 deletions(-)
[PATCH 0/2] ASoC: SOF: Fix IPC reliability and post-resume SoundWire init
Posted by Cole Leavitt 1 month, 2 weeks ago
Two fixes for SOF IPC4 reliability issues observed on Lenovo ThinkPad
P16 Gen 3 (Arrow Lake-S, CS42L43 + CS35L56 over SoundWire):

1. Replace the broken delayed_ipc_tx_msg mechanism with a bounded retry
   loop. The old deferred dispatch silently drops messages during D0i3
   transitions, causing 500ms+ hangs per IPC chunk.

2. Add a platform ops callback (dai_link_hw_ready) so Intel HDA
   platforms can wait for SoundWire slave initialization before ALH
   copier setup. Without this, the DSP enters an unrecoverable wedged
   state when userspace opens a PCM before slaves finish re-enumerating
   after resume.

Tested on ThinkPad P16 Gen 3 with repeated suspend/resume cycles
and concurrent audio playback.

Cole Leavitt (2):
  ASoC: SOF: Replace IPC TX busy deferral with bounded retry
  ASoC: SOF: Add platform ops callback for DAI link hardware readiness

 sound/soc/sof/intel/cnl.c            | 17 ++---------
 sound/soc/sof/intel/hda-common-ops.c |  1 +
 sound/soc/sof/intel/hda-ipc.c        | 17 ++---------
 sound/soc/sof/intel/hda.c            | 44 ++++++++++++++++++++++++++++
 sound/soc/sof/intel/hda.h            | 14 ++++-----
 sound/soc/sof/intel/mtl.c            | 17 ++---------
 sound/soc/sof/ipc4-topology.c        |  8 +++++
 sound/soc/sof/ipc4.c                 | 17 +++++++++--
 sound/soc/sof/sof-priv.h             |  3 ++
 9 files changed, 83 insertions(+), 55 deletions(-)


base-commit: 2687c848e57820651b9f69d30c4710f4219f7dbf
-- 
2.52.0
Re: [PATCH 0/2] ASoC: SOF: Fix IPC reliability and post-resume SoundWire init
Posted by Péter Ujfalusi 1 month, 2 weeks ago
Hi Cole,

On 14/02/2026 08:40, Cole Leavitt wrote:
> Two fixes for SOF IPC4 reliability issues observed on Lenovo ThinkPad
> P16 Gen 3 (Arrow Lake-S, CS42L43 + CS35L56 over SoundWire):
> 
> 1. Replace the broken delayed_ipc_tx_msg mechanism with a bounded retry
>    loop. The old deferred dispatch silently drops messages during D0i3
>    transitions, causing 500ms+ hangs per IPC chunk.
> 
> 2. Add a platform ops callback (dai_link_hw_ready) so Intel HDA
>    platforms can wait for SoundWire slave initialization before ALH
>    copier setup. Without this, the DSP enters an unrecoverable wedged
>    state when userspace opens a PCM before slaves finish re-enumerating
>    after resume.
> 
> Tested on ThinkPad P16 Gen 3 with repeated suspend/resume cycles
> and concurrent audio playback.

This issue is a new one for us and we would like to understand what is
going on, can you create an issue at
https://github.com/thesofproject/linux/issues

and include the full kernel log with sof-dyndbg.conf in place like asked
in this comment:
https://github.com/thesofproject/linux/issues/5517#issuecomment-3233283263

with kernel (Most likely 6.19 based on the base-commit), sof-firmware
and alsa-info.sh output version as well?

In the second patch you are pointing to fw boot timeout issues, which
makes me wonder what is going on.
It is possible that the codec drivers prevent the DSP power off and on
next boot we obviously fail to receive the FW_READY since the DSP and
firmware is in booted state already.

thank you for the help!

> Cole Leavitt (2):
>   ASoC: SOF: Replace IPC TX busy deferral with bounded retry
>   ASoC: SOF: Add platform ops callback for DAI link hardware readiness
> 
>  sound/soc/sof/intel/cnl.c            | 17 ++---------
>  sound/soc/sof/intel/hda-common-ops.c |  1 +
>  sound/soc/sof/intel/hda-ipc.c        | 17 ++---------
>  sound/soc/sof/intel/hda.c            | 44 ++++++++++++++++++++++++++++
>  sound/soc/sof/intel/hda.h            | 14 ++++-----
>  sound/soc/sof/intel/mtl.c            | 17 ++---------
>  sound/soc/sof/ipc4-topology.c        |  8 +++++
>  sound/soc/sof/ipc4.c                 | 17 +++++++++--
>  sound/soc/sof/sof-priv.h             |  3 ++
>  9 files changed, 83 insertions(+), 55 deletions(-)
> 
> 
> base-commit: 2687c848e57820651b9f69d30c4710f4219f7dbf

-- 
Péter

Re: [PATCH 0/2] ASoC: SOF: Fix IPC reliability and post-resume SoundWire init
Posted by Péter Ujfalusi 1 month, 2 weeks ago
Hi Cole,

On 14/02/2026 08:40, Cole Leavitt wrote:
> Two fixes for SOF IPC4 reliability issues observed on Lenovo ThinkPad
> P16 Gen 3 (Arrow Lake-S, CS42L43 + CS35L56 over SoundWire):
> 
> 1. Replace the broken delayed_ipc_tx_msg mechanism with a bounded retry
>    loop. The old deferred dispatch silently drops messages during D0i3
>    transitions, causing 500ms+ hangs per IPC chunk.
> 
> 2. Add a platform ops callback (dai_link_hw_ready) so Intel HDA
>    platforms can wait for SoundWire slave initialization before ALH
>    copier setup. Without this, the DSP enters an unrecoverable wedged
>    state when userspace opens a PCM before slaves finish re-enumerating
>    after resume.
> 
> Tested on ThinkPad P16 Gen 3 with repeated suspend/resume cycles
> and concurrent audio playback.

Thank you for the patch, I have sent them to our CI for testing:
https://github.com/thesofproject/linux/pull/5671

With a brief look the first patch is really nice, better than the
admitably handicapped delayed message workaround.

The second patch is a bit more of a layering violation at first glance,
I'm not sure if I would like code dealing with soundwire nuances in SOF
code itself.
This would need additional thoughts.

> 
> Cole Leavitt (2):
>   ASoC: SOF: Replace IPC TX busy deferral with bounded retry
>   ASoC: SOF: Add platform ops callback for DAI link hardware readiness
> 
>  sound/soc/sof/intel/cnl.c            | 17 ++---------
>  sound/soc/sof/intel/hda-common-ops.c |  1 +
>  sound/soc/sof/intel/hda-ipc.c        | 17 ++---------
>  sound/soc/sof/intel/hda.c            | 44 ++++++++++++++++++++++++++++
>  sound/soc/sof/intel/hda.h            | 14 ++++-----
>  sound/soc/sof/intel/mtl.c            | 17 ++---------
>  sound/soc/sof/ipc4-topology.c        |  8 +++++
>  sound/soc/sof/ipc4.c                 | 17 +++++++++--
>  sound/soc/sof/sof-priv.h             |  3 ++
>  9 files changed, 83 insertions(+), 55 deletions(-)
> 
> 
> base-commit: 2687c848e57820651b9f69d30c4710f4219f7dbf

-- 
Péter