Skip to content

ipc: ipc4: fixes to DMA driver use in user-space builds#10844

Open
kv2019i wants to merge 2 commits into
thesofproject:mainfrom
kv2019i:202606-dai-dma-usage
Open

ipc: ipc4: fixes to DMA driver use in user-space builds#10844
kv2019i wants to merge 2 commits into
thesofproject:mainfrom
kv2019i:202606-dai-dma-usage

Conversation

@kv2019i

@kv2019i kv2019i commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

A set of small fixes to how IPC4 code uses DMA driver and driver look-up interfaces.

Patches part of feature development done in #10558

kv2019i added 2 commits June 4, 2026 19:28
Use sof_dma_get_status() call to allow the audio pipeline to
be run in user-space.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Fix a few remaining uses of direct DMA driver calls. Use
the sof_dma.h wrapper instead, allowing the code to be used
also from user-space.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Copilot AI review requested due to automatic review settings June 4, 2026 16:34
@kv2019i kv2019i requested review from jsarha and lyakh June 4, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates IPC4 code paths to be compatible with Zephyr user-space LL builds by avoiding privileged DMA and interrupt APIs, while keeping existing behavior for non-user-space builds.

Changes:

  • Make IPC4 component driver lookup avoid irq_local_disable() in user-space LL builds.
  • Switch IPC4 DAI DMA operations from direct Zephyr DMA calls to sof_dma_*() wrappers for stop/release/status.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/ipc/ipc4/helper.c Conditionally avoids IRQ masking during driver lookup in user-space LL builds.
src/ipc/ipc4/dai.c Uses sof_dma_*() wrapper APIs for DMA stop/release/status in IPC4 DAI paths.

Comment thread src/ipc/ipc4/helper.c Outdated
Comment on lines +1134 to +1136
#ifndef CONFIG_SOF_USERSPACE_LL
uint32_t flags;
#endif
Comment thread src/ipc/ipc4/helper.c
* list is immutable by this point so no lock is needed.
*/
#ifndef CONFIG_SOF_USERSPACE_LL
irq_local_disable(flags);
Comment thread src/ipc/ipc4/helper.c
}

#ifndef CONFIG_SOF_USERSPACE_LL
irq_local_enable(flags);
Comment thread src/ipc/ipc4/helper.c Outdated
struct comp_driver_info *info;
#ifndef CONFIG_SOF_USERSPACE_LL
uint32_t flags;
#endif

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 commit seems to suggest that no locking is needed here at all... Maybe remove it completely and see if it explodes?..

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.

@lyakh With current limited CI on-device coverage, not very eager to make such see-if-it-explodes tests. But this really does seems to be the case. Drivers list is initiated at component init and only dynamic code path to register is lib_manager_register_module(). @lgirdwood you were adding module reloading, could this lead to need to have locking for the driver list?

@lgirdwood

Copy link
Copy Markdown
Member

@lyakh good now ?

@lyakh

lyakh commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

@lyakh good now ?

@lgirdwood @kv2019i cannot say I'm particularly happy with the last commit in the series, sorry. If anything the comment doesn't seem quite right. That driver searching is done exactly when drivers are added to the list during LLEXT module loading. So I don't think "the (driver) list is immutable by this point" description is quite right. I'm not saying that the locking is needed there, possibly it isn't, but for a different reason - because searching for drivers is serialised with adding them. So for that reason the lock might be redundant. Or indeed we could replace it with a userspace-compatible lock because driver loading isn't time-critical and we don't expect any contention there. So... The commit might well be harmless and certainly helpful for the userspace, but TBH it doesn't seem very convincing to me.

@kv2019i kv2019i force-pushed the 202606-dai-dma-usage branch from 95254e7 to 73870dc Compare June 9, 2026 10:03
@kv2019i

kv2019i commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

V3 pushed:

  • dropped the 3rd patch, no changes otherwise

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