ipc4: handler: only set pm_prepare_D3 when CONFIG_PM is enabled - #11175
Conversation
pm_prepare_D3 gates ipc_send_queued_msg() and is only cleared from ipc_device_resume_handler(), which needs CONFIG_PM to run. On builds with CONFIG_PM=n no one clears it, so the IPC queue stalls after a SET_DX message. Guard the assignment with CONFIG_PM, like the task_mask handling just above. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, matches existing nearby configuration-guard patterns, and directly prevents pm_prepare_D3 from blocking queued IPC sends on CONFIG_PM=n builds.
Pull request overview
This PR fixes an IPC4 power-management edge case where pm_prepare_D3 could be set on CONFIG_PM=n builds, but never cleared (because the resume path that clears it is only present when PM is enabled), causing ipc_send_queued_msg() to stop draining the IPC queue after a SET_DX message.
Changes:
- Wrap
ipc_get()->pm_prepare_D3 = 1;in#if defined(CONFIG_PM)within the IPC4SET_DXhandler. - Align
pm_prepare_D3handling with the adjacenttask_maskpowerdown gating logic already conditional onCONFIG_PM.
File summaries
| File | Description |
|---|---|
| src/ipc/ipc4/handler-kernel.c | Guards pm_prepare_D3 assignment behind CONFIG_PM to prevent IPC queue stalling on non-PM builds. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
PR 11175: test resultsRun date: 2026-09-07 13:49 UTC Tested commit: 38fb366031cef48434ebfc3f19dc5988c52a31e8 |
tmleman
left a comment
There was a problem hiding this comment.
It shouldn't affect us so I'm fine with that.
Will there be no negative consequences for you doing a power off without setting this flag? And just out of curiosity, are you planning to enable PM later?
|
At some point we will try to enable PM. This change is mostly because of the symmetry with ipc_device_resume_handler where the flag is cleared only for CONFIG_PM=y |
|
Fuzzer fails are known, tracked in #11157 . Rest looks good, proceeding with merge. |
pm_prepare_D3 gates ipc_send_queued_msg() and is only cleared from ipc_device_resume_handler(), which needs CONFIG_PM to run. On builds with CONFIG_PM=n no one clears it, so the IPC queue stalls after a SET_DX message. Guard the assignment with CONFIG_PM, like the task_mask handling just above.