Skip to content

Commit 3da40dd

Browse files
committed
schedule: ll: userspace: grant the LL thread rights on DP
The LL userspace thread has to interact with the DP one. Grant required rights. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 51082f6 commit 3da40dd

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/include/sof/schedule/ll_schedule_domain.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ struct ll_schedule_domain *zephyr_domain_init(int clk);
329329
#ifdef CONFIG_SOF_USERSPACE_LL
330330
struct k_thread *zephyr_domain_thread_tid(struct ll_schedule_domain *domain);
331331
struct k_mem_domain *zephyr_ll_mem_domain(void);
332+
struct ll_schedule_domain *zephyr_ll_domain_for_core(unsigned int core);
333+
struct k_thread *zephyr_ll_domain_thread(unsigned int core);
332334
#endif /* CONFIG_SOF_USERSPACE_LL */
333335
#endif /* __ZEPHYR__ */
334336

src/schedule/zephyr_domain.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,20 @@ struct k_thread *zephyr_domain_thread_tid(struct ll_schedule_domain *domain)
498498
return dt->ll_thread;
499499
}
500500

501+
struct k_thread *zephyr_ll_domain_thread(unsigned int core)
502+
{
503+
struct ll_schedule_domain *ll_domain = zephyr_ll_domain_for_core(core);
504+
505+
if (!ll_domain)
506+
return NULL;
507+
508+
struct zephyr_domain *zephyr_domain = ll_sch_domain_get_pdata(ll_domain);
509+
510+
struct zephyr_domain_thread *dt = zephyr_domain->domain_thread + core;
511+
512+
return dt->ll_thread;
513+
}
514+
501515
#endif /* CONFIG_SOF_USERSPACE_LL */
502516

503517
#if CONFIG_CROSS_CORE_STREAM

src/schedule/zephyr_dp_schedule_application.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
536536

537537
k_thread_access_grant(thread_ipc, pdata->event, pdata->thread_id, p_stack, &dp_sync[core]);
538538
scheduler_dp_grant(thread_ipc, core);
539+
scheduler_dp_grant(zephyr_ll_domain_thread(core), core);
539540
#endif
540541

541542
struct k_mem_domain *mdom = objpool_alloc(&dp_mdom_head, sizeof(*mdom),

src/schedule/zephyr_ll.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,3 +831,15 @@ struct ll_schedule_domain *zephyr_ll_domain(void)
831831

832832
return ll_sch ? ll_sch->ll_domain : NULL;
833833
}
834+
835+
/* Return a pointer to the LL scheduler timer domain */
836+
struct ll_schedule_domain *zephyr_ll_domain_for_core(unsigned int core)
837+
{
838+
#if CONFIG_SOF_USERSPACE_LL
839+
struct zephyr_ll *ll_sch = scheduler_get_data_for_core(SOF_SCHEDULE_LL_TIMER, core);
840+
#else
841+
struct zephyr_ll *ll_sch = scheduler_get_data(SOF_SCHEDULE_LL_TIMER);
842+
#endif
843+
844+
return ll_sch ? ll_sch->ll_domain : NULL;
845+
}

0 commit comments

Comments
 (0)