Skip to content

Commit 9cdb1be

Browse files
committed
RD: test_ll_task: hack to allow access to DAI copier mutex
This is temporary and not needed anymore when DAI is also created in user-space.
1 parent 6d4c8bd commit 9cdb1be

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/audio/dai-zephyr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ __cold int dai_common_new(struct dai_data *dd, struct comp_dev *dev,
510510

511511
#ifdef CONFIG_SOF_USERSPACE_LL
512512
dd->dai->lock = k_object_alloc(K_OBJ_MUTEX);
513+
comp_set_drvdata(dev, dd);
513514
#else
514515
dd->dai->lock = &dd->dai->lock_obj;
515516
#endif

zephyr/test/userspace/test_ll_task.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,15 @@ static void pipeline_two_components(bool run_in_user)
446446
user_grant_dma_access_all(&ppl_user_thread);
447447
user_access_to_mailbox(zephyr_ll_mem_domain(), &ppl_user_thread);
448448

449+
/*
450+
* A hack for testing purposes, normally DAI module
451+
* is created in user-space so it gets access
452+
* automatically. Until that works, use dai_dd directly.
453+
*/
454+
struct dai_data *dai_dd = comp_get_drvdata(ctx->dai_comp);
455+
struct k_mutex *dai_lock = dai_dd->dai->lock;
456+
k_thread_access_grant(&ppl_user_thread, dai_lock);
457+
449458
k_thread_start(&ppl_user_thread);
450459

451460
LOG_INF("user thread started, waiting for completion");

0 commit comments

Comments
 (0)