diff --git a/src/audio/module_adapter/library/userspace_proxy.c b/src/audio/module_adapter/library/userspace_proxy.c index 3859fbd129f9..4154bad3781d 100644 --- a/src/audio/module_adapter/library/userspace_proxy.c +++ b/src/audio/module_adapter/library/userspace_proxy.c @@ -220,12 +220,14 @@ static int userspace_proxy_invoke(struct userspace_context *user_ctx, uint32_t c goto done; } +#ifdef CONFIG_SCHED_CPU_MASK /* Pin worker thread to the same core as the module */ ret = k_thread_cpu_pin(worker.thread_id, cpu_get_id()); if (ret < 0) { tr_err(&userspace_proxy_tr, "Failed to pin cpu, error: %d", ret); goto done; } +#endif ret = k_work_user_submit_to_queue(&worker.work_queue, &user_ctx->work_item->work_item); if (ret < 0) { diff --git a/src/debug/debug_stream/debug_stream_thread_info.c b/src/debug/debug_stream/debug_stream_thread_info.c index 5e00b697caa9..5c0d1bd7ffb1 100644 --- a/src/debug/debug_stream/debug_stream_thread_info.c +++ b/src/debug/debug_stream/debug_stream_thread_info.c @@ -367,12 +367,14 @@ static int thread_info_start(void) LOG_ERR("k_thread_create() failed for core %u", i); continue; } +#ifdef CONFIG_SCHED_CPU_MASK ret = k_thread_cpu_pin(tid, i); if (ret < 0) { LOG_ERR("Pinning thread to code core %u", i); k_thread_abort(tid); continue; } +#endif snprintf(name, sizeof(name), "%u thread info", i); ret = k_thread_name_set(tid, name); if (ret < 0) diff --git a/src/ipc/ipc-common.c b/src/ipc/ipc-common.c index 10f241784625..3c9cbc14d958 100644 --- a/src/ipc/ipc-common.c +++ b/src/ipc/ipc-common.c @@ -337,7 +337,9 @@ __cold int ipc_init(struct sof *sof) k_thread_suspend(thread); +#ifdef CONFIG_SCHED_CPU_MASK k_thread_cpu_pin(thread, PLATFORM_PRIMARY_CORE_ID); +#endif k_thread_name_set(thread, "ipc_send_wq"); k_thread_resume(thread); diff --git a/src/schedule/zephyr_dma_domain.c b/src/schedule/zephyr_dma_domain.c index 84165d363229..9bb76660ab29 100644 --- a/src/schedule/zephyr_dma_domain.c +++ b/src/schedule/zephyr_dma_domain.c @@ -461,8 +461,10 @@ static int zephyr_dma_domain_register(struct ll_schedule_domain *domain, 0, K_FOREVER); +#ifdef CONFIG_SCHED_CPU_MASK k_thread_cpu_mask_clear(thread); k_thread_cpu_mask_enable(thread, core); +#endif k_thread_name_set(thread, thread_name); k_thread_start(thread); diff --git a/src/schedule/zephyr_domain.c b/src/schedule/zephyr_domain.c index 6a5812353d9e..ebf5aea8d4d2 100644 --- a/src/schedule/zephyr_domain.c +++ b/src/schedule/zephyr_domain.c @@ -216,8 +216,10 @@ static int zephyr_domain_register(struct ll_schedule_domain *domain, zephyr_domain_thread_fn, zephyr_domain, INT_TO_POINTER(core), NULL, CONFIG_LL_THREAD_PRIORITY, 0, K_FOREVER); +#ifdef CONFIG_SCHED_CPU_MASK k_thread_cpu_mask_clear(thread); k_thread_cpu_mask_enable(thread, core); +#endif k_thread_name_set(thread, thread_name); k_thread_start(thread); @@ -330,8 +332,10 @@ static int zephyr_domain_register_user(struct ll_schedule_domain *domain, INT_TO_POINTER(core), NULL, CONFIG_LL_THREAD_PRIORITY, K_USER, K_FOREVER); +#ifdef CONFIG_SCHED_CPU_MASK k_thread_cpu_mask_clear(thread); k_thread_cpu_mask_enable(thread, core); +#endif k_thread_name_set(thread, thread_name); k_mem_domain_add_thread(zephyr_ll_mem_domain(), thread); diff --git a/src/schedule/zephyr_dp_schedule_application.c b/src/schedule/zephyr_dp_schedule_application.c index 35dd072040c4..ee2fc102fbff 100644 --- a/src/schedule/zephyr_dp_schedule_application.c +++ b/src/schedule/zephyr_dp_schedule_application.c @@ -493,12 +493,14 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid, stack_size, dp_thread_fn, ptask, NULL, NULL, CONFIG_DP_THREAD_PRIORITY, ptask->flags, K_FOREVER); +#ifdef CONFIG_SCHED_CPU_MASK /* pin the thread to specific core */ ret = k_thread_cpu_pin(pdata->thread_id, core); if (ret < 0) { tr_err(&dp_tr, "zephyr task pin to core failed"); goto e_thread; } +#endif k_thread_access_grant(pdata->thread_id, pdata->event, &dp_sync[core]); scheduler_dp_grant(pdata->thread_id, core); diff --git a/src/schedule/zephyr_dp_schedule_thread.c b/src/schedule/zephyr_dp_schedule_thread.c index cb9e8174e67a..7fbb3b6a5c21 100644 --- a/src/schedule/zephyr_dp_schedule_thread.c +++ b/src/schedule/zephyr_dp_schedule_thread.c @@ -287,12 +287,14 @@ int scheduler_dp_task_init(struct task **task, CONFIG_DP_THREAD_PRIORITY, task_memory->task.flags, K_FOREVER); +#ifdef CONFIG_SCHED_CPU_MASK /* pin the thread to specific core */ ret = k_thread_cpu_pin(pdata->thread_id, core); if (ret < 0) { tr_err(&dp_tr, "zephyr task pin to core failed"); goto e_thread; } +#endif #ifdef CONFIG_USERSPACE if (options & K_USER) { diff --git a/src/schedule/zephyr_twb_schedule.c b/src/schedule/zephyr_twb_schedule.c index 8ba28595cfa3..aee61360d697 100644 --- a/src/schedule/zephyr_twb_schedule.c +++ b/src/schedule/zephyr_twb_schedule.c @@ -441,6 +441,7 @@ int scheduler_twb_task_init(struct task **task, goto err; } +#ifdef CONFIG_SCHED_CPU_MASK /* pin the thread to specific core */ ret = k_thread_cpu_pin(thread_id, core); if (ret < 0) { @@ -448,6 +449,7 @@ int scheduler_twb_task_init(struct task **task, tr_err(&twb_tr, "zephyr task pin to core %d failed", core); goto err; } +#endif /* set the thread name */ if (name) { diff --git a/west.yml b/west.yml index 3f7546d03d38..a49378a92203 100644 --- a/west.yml +++ b/west.yml @@ -43,7 +43,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: 684c9e8f32e4373a21098559f748f06915f950c9 + revision: 217a5ac0ca4671ec0cf5c1fd4ea1d222f492fe1e remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision diff --git a/zephyr/edf_schedule.c b/zephyr/edf_schedule.c index cc224be4bb05..1a0231426c27 100644 --- a/zephyr/edf_schedule.c +++ b/zephyr/edf_schedule.c @@ -113,8 +113,10 @@ int scheduler_init_edf(void) k_thread_suspend(thread); k_thread_heap_assign(thread, sof_sys_heap_get()); +#ifdef CONFIG_SCHED_CPU_MASK k_thread_cpu_mask_clear(thread); k_thread_cpu_mask_enable(thread, PLATFORM_PRIMARY_CORE_ID); +#endif k_thread_name_set(thread, "edf_workq"); k_thread_resume(thread);