Repository navigation
Conversation
mod_ipc_msg_w_ext_init() allocates the ipc_msg and its tx_data with mod_zalloc(), which uses SOF_MEM_FLAG_USER only and thus returns cached memory. Before the conversion the message was allocated with SOF_MEM_FLAG_COHERENT. msg->list is linked into the uncached ipc->msg_list by the module (possibly on a secondary core or DP thread) and unlinked by the IPC send worker on the primary core. With a cached msg the worker operates on stale list pointers, list_item_del() fails to unlink the message and the same notification is sent to the host over and over again. Allocate the message and its payload with SOF_MEM_FLAG_COHERENT, as it was done before. Fixes: 97dd710 ("ipc: make IPC message allocation userspace-safe") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused change matches the established IPC allocation behavior and resolves the cross-core cache coherency regression.
Review effort: Balanced
Findings: None
What changed in this PR
Restores coherent memory allocation for module-owned IPC messages to prevent stale cross-core queue and payload data.
Changes:
- Allocates IPC message structures and payloads with coherent memory flags.
- Explicitly zero-initializes both allocations.
| File | Description |
|---|---|
src/include/sof/audio/module_adapter/module/generic.h |
Restores coherent allocation in module IPC helpers. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kv2019i
left a comment
There was a problem hiding this comment.
Looks good. Tested on PTL and this fixes the end-of-stream ramp.
jsarha
left a comment
There was a problem hiding this comment.
Indeed. I do not think I would have made that error my self, but delegating code writing to AI has its caveats.
PR 11277: test resultsRun date: 2026-10-06 16:06 UTC Tested commit: aac3ca927c96791c39b7ba0c07c3c635b451d621 |
mod_ipc_msg_w_ext_init() allocates the ipc_msg and its tx_data with mod_zalloc(), which uses SOF_MEM_FLAG_USER only and thus returns cached memory. Before the conversion the message was allocated with SOF_MEM_FLAG_COHERENT.
msg->list is linked into the uncached ipc->msg_list by the module (possibly on a secondary core or DP thread) and unlinked by the IPC send worker on the primary core. With a cached msg the worker operates on stale list pointers, list_item_del() fails to unlink the message and the same notification is sent to the host over and over again.
Allocate the message and its payload with SOF_MEM_FLAG_COHERENT, as it was done before.
Fixes: 97dd710 ("ipc: make IPC message allocation userspace-safe")