From 2a9c709b196220482f9b2615e21638b8f481865c Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 19 Mar 2026 21:39:40 +0200 Subject: [PATCH 1/3] ipc: ipc4: use correct API to get DMA status Use sof_dma_get_status() call to allow the audio pipeline to be run in user-space. Signed-off-by: Kai Vehmanen --- src/ipc/ipc4/dai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/ipc4/dai.c b/src/ipc/ipc4/dai.c index 58c08d9ec04b..1a0135cb5d5d 100644 --- a/src/ipc/ipc4/dai.c +++ b/src/ipc/ipc4/dai.c @@ -450,7 +450,7 @@ void dai_dma_position_update(struct dai_data *dd, struct comp_dev *dev) if (!dd->slot_info.node_id) return; - ret = dma_get_status(dd->dma->z_dev, dd->chan_index, &status); + ret = sof_dma_get_status(dd->dma, dd->chan_index, &status); if (ret < 0) return; From 73870dc465dfbfe251612c94df994dca7bd8cebf Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 20 May 2026 10:04:10 +0300 Subject: [PATCH 2/3] ipc: ipc4: dai: fix direct use of DMA driver calls 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 --- src/ipc/ipc4/dai.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipc/ipc4/dai.c b/src/ipc/ipc4/dai.c index 1a0135cb5d5d..1540d95cf0f0 100644 --- a/src/ipc/ipc4/dai.c +++ b/src/ipc/ipc4/dai.c @@ -236,9 +236,9 @@ void dai_dma_release(struct dai_data *dd, struct comp_dev *dev) * TODO: refine power management when stream is paused */ /* if reset is after pause dma has already been stopped */ - dma_stop(dd->dma->z_dev, dd->chan_index); + sof_dma_stop(dd->dma, dd->chan_index); - dma_release_channel(dd->dma->z_dev, dd->chan_index); + sof_dma_release_channel(dd->dma, dd->chan_index); dd->chan_index = -EINVAL; } } From 95254e755a39777882ee76f5212078849b08c45e Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Tue, 31 Mar 2026 14:45:40 +0300 Subject: [PATCH 3/3] ipc: ipc4: helper: make ipc4_search_for_drv() userspace compatible Do not use IRQ disable/enable when built for user-space. The driver list is immutable by IPC processing time so no lock is needed. Signed-off-by: Kai Vehmanen --- src/ipc/ipc4/helper.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 8e3073ab7797..1798de75342d 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -1131,11 +1131,19 @@ __cold static const struct comp_driver *ipc4_search_for_drv(const void *uuid) struct list_item *clist; const struct comp_driver *drv = NULL; struct comp_driver_info *info; +#ifndef CONFIG_SOF_USERSPACE_LL uint32_t flags; +#endif assert_can_be_cold(); + /* Driver list is populated at boot before IPC processing starts. + * In user-space builds irq_local_disable() is privileged, but the + * list is immutable by this point so no lock is needed. + */ +#ifndef CONFIG_SOF_USERSPACE_LL irq_local_disable(flags); +#endif /* search driver list with UUID */ list_for_item(clist, &drivers->list) { @@ -1151,7 +1159,9 @@ __cold static const struct comp_driver *ipc4_search_for_drv(const void *uuid) } } +#ifndef CONFIG_SOF_USERSPACE_LL irq_local_enable(flags); +#endif return drv; }