Skip to content

dp, pipeline, ipc4: core DP binding, hostless WoV routing, and platform hardening - #11505

Draft
lgirdwood wants to merge 16 commits into
thesofproject:mainfrom
lgirdwood:wov-pr2-core-dp
Draft

lgirdwood wants to merge 16 commits into
thesofproject:mainfrom
lgirdwood:wov-pr2-core-dp

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Split from #11471 (wov-d0i3).

Summary

  • Support DP-to-DP component binding (comp_buffer, ipc4/handler.c).
  • Use k_mutex for DP lock and initialize DP scheduler on cAVS (zephyr_dp_schedule, platform).
  • Support virtual detect sink and unset legacy sink params in module_adapter.
  • Support hostless pipelines and dynamic WoV routing (pipeline, ipc4).
  • Add teardown NULL guards, blocking IDC notify, log throttling, UAOL link answer filtering, and PTL Intel debug signing key in sof_ri_info.

Testing

  • Compiled PTL firmware (intel_adsp/ace30/ptl) cleanly and verified scripts/check_kernel_includes.py --strict.

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some of these patches are quite busy and could be further split. The history for split is in the wov-001 tag

caps->link_caps[i].bidirectional_streams_supported = dev_cap.bidirectional_streams;
caps->link_caps[i].max_tx_fifo_size = dev_cap.max_tx_fifo_size;
caps->link_caps[i].max_rx_fifo_size = dev_cap.max_rx_fifo_size;
caps->link_caps[link_count].input_streams_supported = dev_cap.input_streams;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This patch should be from @ujfalusi - looks like the squashing missed this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed: re-attributed audio: intel_uaol: only advertise UAOL links that answered (1b955da2f) to @ujfalusi (Author: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>).

dai_common_free(cd->dd[i]);
mod_free(mod, cd->dd[i]->gain_data);
mod_free(mod, cd->dd[i]);
if (cd->dd[i]) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this should be split into 5 patches, one for each subject above with correct author from the wov-001 tag.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed: split into 5 atomic commits matching wov-001 subjects and authors:

  • 5b03191fa (Liam Girdwood) lib, audio: add NULL guards during DAI, DMA, and copier teardown
  • 0f964d360 (Liam Girdwood) ipc: ipc-helper: reset component before freeing if not in ready state
  • 9b0f3a6a5 (Seppo Ingalsuo) lib: notifier: wait for completion of remote core notifications
  • 44d7281ad (Seppo Ingalsuo) lib: agent: guard against NULL system agent in sa_set_panic_on_delay()
  • 6713c7ec9 (Seppo Ingalsuo) audio: host-zephyr: increase minimum no-bytes warning interval


err = comp_prepare(current);
if (err < 0 || err == PPL_STATUS_PATH_STOP)
if (err < 0 || err == PPL_STATUS_PATH_STOP) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This patch looks like we can again split and attribute correct author from wov-001 tag.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed: split into 3 commits from wov-001 (3ef8df0a4, d4de9e8af, 063afaf4e):

  • d6a84361d (Liam Girdwood) zephyr: edf_schedule: cancel delayed work in schedule_edf_task_free()
  • 792377dd1 (Liam Girdwood) audio: pipeline: log comp_prepare failure and export pipeline_schedule_cancel()
  • 73af4bb44 (Liam Girdwood) ipc4: handler: support hostless pipelines and COMP_STATE_PREPARE

unsigned int period = UINT32_MAX;

for (int i = 0; i < mod->num_of_sinks; i++) {
unsigned int frame_bytes = sink_get_frame_bytes(mod->sinks[i]);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can we say in teh commit message why this is needed for WOV and state flow.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed: split into the 3 commits from wov-001 (ae85ce2a7, 15d4ff177, 4541bd306) and expanded the commit messages in b4b9244c6 (Peter Ujfalusi) and f92a5bfc2 (Seppo Ingalsuo) to explain why propagating mod->stream_params to legacy consumers and skipping zero-rate/frame-size virtual detect sinks are required during the WoV INIT -> PREPARE -> ACTIVE state flow.

Comment thread src/ipc/ipc4/helper.c Outdated
Comment on lines +950 to +952
#endif

#ifdef CONFIG_DP_TO_DP_BIND

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

needed ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Cleaned up and split into the two original wov-001 commits (7225643e4 by Seppo Ingalsuo, d24b603af by Liam Girdwood):

  • Merged the redundant back-to-back #endif / #ifdef CONFIG_DP_TO_DP_BIND blocks at src/ipc/ipc4/helper.c:952 into one block (vregion_get keeps the DP module vregion alive across independent source/sink teardown until ring_buffer_free(), and dp_to_dp attaches the single shared ring_buffer on both sides).
  • Also fixed ring_buffer_free() (src/audio/buffers/ring_buffer.c) to call vregion_put(alloc->vreg) directly rather than dereferencing alloc via sof_heap_free(alloc->heap, alloc) after vregion_put() destroys the vregion.

singalsu and others added 16 commits November 22, 2026 18:01
Binding two DP (Data Processing) scheduled components was previously
rejected with IPC4_INVALID_REQUEST because both sides required a
secondary ring buffer. Add support for DP-to-DP component binding under
CONFIG_DP_TO_DP_BIND.

In a DP-to-DP connection, a single shared ring buffer is created and
attached as a secondary buffer on both the source and sink sides of the
intermediate comp_buffer. The upstream DP module writes directly to the
ring buffer sink API, and the downstream DP module reads directly from
its source API with no intermediate LL-cycle copy.

The DP module virtual memory region backing the ring buffer is
refcounted so that it remains valid across component lifetimes, and
audio buffer reset and free operations ensure the shared secondary
buffer is not reset or freed twice.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
When source or sink component is not a processing_module (such as a host
copier or non-module comp_dev), comp_mod() returns NULL.
Guard src_module_data and dst_module_data before accessing
mpd.in_buff_size and mpd.out_buff_size to prevent NULL pointer
dereferences when configuring DP ring buffers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
The DP lock is taken by the LL thread on every tick in
scheduler_dp_ll_tick() and by each DP thread after every run. Using a
k_sem has no priority inheritance, so when a DP thread holding the lock
is preempted by other DP threads, the cooperative high-priority LL
thread stalls until the holder runs again.

With several busy DP modules active (such as multiple WoV detector
pipelines), using a k_mutex lets the lock holder inherit the LL priority
so LL max latency drops without DMA xruns.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…uffer()

The limit parameter of audio_buffer_sync_secondary_buffer() is of type
size_t. Pass SIZE_MAX instead of UINT_MAX for unlimited input copy to
match the parameter type and avoid size mismatches on 64-bit platforms.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
In WoV pipelines, DP modules (such as ECNS or keyword detectors) may feed
legacy LL comp_driver components (e.g. KPB or a WoV arbiter) that do not
populate their input buffer audio_stream_params at bind time. During the
IPC4 INIT -> PREPARE state transition, module_adapter_calculate_dp_period()
queries sink frame_bytes and rate, hitting a zero rate / divide-by-zero
or missing period calculation if params remain unset.

Before calculating the DP period in module_adapter_prepare(), propagate
mod->stream_params to any sink buffer whose audio_stream rate is still zero.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…tion

In WoV multi-detector pipelines, keyword detectors (such as
microWakeWord) can have an active dummy/virtual detect sink connected
only for graph/route completeness while reporting detection events over
IPC/notifier rather than producing an audio stream (frame_bytes == 0 or
rate == 0).

During the IPC4 INIT -> PREPARE -> ACTIVE pipeline state transition,
module_adapter_prepare() invokes module_adapter_calculate_dp_period() on
every connected sink. Without skipping sinks that carry no audio format,
(frame_bytes * rate) evaluates to zero and causes a divide-by-zero fault
before the WoV pipeline can enter COMP_STATE_PREPARE / COMP_STATE_ACTIVE.
Skipping non-audio sinks lets the existing source/module period
fallback complete pipeline preparation cleanly.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Cancel any pending z_delayed_work when freeing an EDF scheduler task to
prevent a queued delayed work callback from firing on a cleared task during
pipeline teardown.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…e_cancel()

Log the failing component ID in pipeline_comp_prepare() when prepare
fails, guard NULL pipe_task pointers in pipeline_schedule_copy() and
pipeline_schedule_cancel(), and export pipeline_schedule_cancel() for
synchronous hostless pipeline state transitions.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Support internal/hostless WoV processing pipelines that lack a host or DAI
endpoint copier by executing trigger/reset transitions synchronously
when !pipeline_is_endpoint(), and handle COMP_STATE_PREPARE and
COMP_STATE_SUSPEND transitions in ipc4_pipeline_prepare() and
ipc4_pipeline_trigger().

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Guard NULL pointers in dai_put(), sof_dma_put(), dai_common_free(),
dai_free(), and copier_dai_free(), and clear released buffer/DAI/DMA
pointers after freeing to prevent double-free or NULL dereference on
partial pipeline teardown.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Stop active components and reset non-ready components in ipc_comp_free()
so dynamically torn down modules release DMA/DAI and memory resources
cleanly before freeing.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Use IDC_BLOCKING in notifier_event() so back-to-back cross-core
notifications to the same remote core cannot reuse a queued IDC work
item and overwrite notify_data before delivery.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Return early in sa_set_panic_on_delay() if sof_get()->sa is NULL when
pipelines change state before system agent initialization completes.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Increase SOF_MIN_NO_BYTES_INTERVAL_MS from 20 ms to 1000 ms to prevent
XRUN warning bursts from flooding the trace buffer during steady-state
or WoV transitions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Count only UAOL links whose uaol_get_capabilities() call succeeded, pack
link_caps[] from index 0, and size the returned TLV to match instead of
advertising unresponsive links with zeroed capabilities.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Recognize the PTL Intel debug signing key in sof_ri_info.py.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood

Copy link
Copy Markdown
Member Author

Rebased wov-pr2-core-dp onto current origin/main (8eebb1cf3), split the busy commits into 16 atomic commits matching the wov-001 history and authors, addressed all review comments, and verified on Ladybird (WCL-U).

Updated Commit Series (7225643e4..bee305611)

  1. 7225643e4 — audio: buffers/ipc4: add DP-to-DP component binding (Seppo Ingalsuo) (merged redundant #ifdef CONFIG_DP_TO_DP_BIND in helper.c, fixed post-vregion_put() sof_heap_free in ring_buffer_free(), dropped unnecessary vregion.c include)
  2. d24b603af — ipc4: helper: guard NULL module_data in ipc4_comp_connect() (Liam Girdwood)
  3. 0a3c32664 — schedule: zephyr_dp_schedule: use a mutex for the per-core DP lock (Peter Ujfalusi) (updated subject/body to drop already-merged cAVS platform init note)
  4. 7f4868ec7 — audio: module_adapter: pass SIZE_MAX to audio_buffer_sync_secondary_buffer() (Seppo Ingalsuo)
  5. b4b9244c6 — audio: module_adapter: set DP sink params left unset by legacy consumers (Peter Ujfalusi) (expanded WoV INIT -> PREPARE state-flow rationale)
  6. f92a5bfc2 — audio: module_adapter: skip virtual detect sinks in DP period calculation (Seppo Ingalsuo) (expanded WoV virtual-detect-sink state-flow rationale)
  7. d6a84361d — zephyr: edf_schedule: cancel delayed work in schedule_edf_task_free() (Liam Girdwood)
  8. 792377dd1 — audio: pipeline: log comp_prepare failure and export pipeline_schedule_cancel() (Liam Girdwood)
  9. 73af4bb44 — ipc4: handler: support hostless pipelines and COMP_STATE_PREPARE (Liam Girdwood)
  10. 5b03191fa — lib, audio: add NULL guards during DAI, DMA, and copier teardown (Liam Girdwood)
  11. 0f964d360 — ipc: ipc-helper: reset component before freeing if not in ready state (Liam Girdwood)
  12. 9b0f3a6a5 — lib: notifier: wait for completion of remote core notifications (Seppo Ingalsuo)
  13. 44d7281ad — lib: agent: guard against NULL system agent in sa_set_panic_on_delay() (Seppo Ingalsuo)
  14. 6713c7ec9 — audio: host-zephyr: increase minimum no-bytes warning interval (Seppo Ingalsuo)
  15. 1b955da2f — audio: intel_uaol: only advertise UAOL links that answered (Peter Ujfalusi)
  16. bee305611 — sof_ri_info: add PTL Intel debug signing key (Liam Girdwood)

Ladybird (WCL-U) Hardware & Local Verification

  • Build & Signing: Built wcl (-o sof/app/llext_relocatable.conf -k keys/ptl_private_key.pem --key-type-subdir dbgkey) cleanly and verified sof_ri_info.py recognizes (PTL Intel debug key) on sof-wcl.ri.
  • Kernel Includes Check: scripts/check_kernel_includes.py --strict build-wcl exited 0 (baseline 16 files / 15 headers).
  • DUT Execution (root@ladybird): Deployed dbgkey/sof-wcl.ri, dbgkey/sof-wcl-openmodules.ri, and LLEXT libs; reloaded snd_sof_pci_intel_ptl (Booted firmware version: 2.15.99.1), verified 4-ch capture (plughw:0,4, plughw:0,10), Jack Out (plughw:0,0) & Speaker (plughw:0,2) playback, D0I0 -> D3 runtime suspend (suspended), and a clean second rmmod/modprobe reload with zero kernel/DSP errors in dmesg.

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.

4 participants