Skip to content

Commit 494f77b

Browse files
Sergeyserhiy-katsyuba-intel
authored andcommitted
zephyr: remove k_thread_cpu_mask_clear() calls
When CONFIG_SCHED_CPU_MASK_PIN_ONLY is enabled, an empty CPU mask is not allowed. Calling k_thread_cpu_mask_clear() triggers an assertion, which causes firmware boot failure when CONFIG_ASSERT is enabled. Use k_thread_cpu_pin() instead. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
1 parent da43fd6 commit 494f77b

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎src/schedule/zephyr_dma_domain.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,7 @@ static int zephyr_dma_domain_register(struct ll_schedule_domain *domain,
462462
K_FOREVER);
463463

464464
#ifdef CONFIG_SCHED_CPU_MASK
465-
k_thread_cpu_mask_clear(thread);
466-
k_thread_cpu_mask_enable(thread, core);
465+
k_thread_cpu_pin(thread, core);
467466
#endif
468467
k_thread_name_set(thread, thread_name);
469468

‎src/schedule/zephyr_domain.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ static int zephyr_domain_register(struct ll_schedule_domain *domain,
218218
NULL, CONFIG_LL_THREAD_PRIORITY, 0, K_FOREVER);
219219

220220
#ifdef CONFIG_SCHED_CPU_MASK
221-
k_thread_cpu_mask_clear(thread);
222-
k_thread_cpu_mask_enable(thread, core);
221+
k_thread_cpu_pin(thread, core);
223222
#endif
224223
k_thread_name_set(thread, thread_name);
225224

@@ -345,8 +344,7 @@ static int zephyr_domain_thread_init(struct ll_schedule_domain *domain,
345344
K_USER, K_FOREVER);
346345

347346
#ifdef CONFIG_SCHED_CPU_MASK
348-
k_thread_cpu_mask_clear(thread);
349-
k_thread_cpu_mask_enable(thread, core);
347+
k_thread_cpu_pin(thread, core);
350348
#endif
351349
k_thread_name_set(thread, thread_name);
352350

‎zephyr/edf_schedule.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ __cold int scheduler_init_edf(void)
117117

118118
k_thread_heap_assign(thread, sof_sys_heap_get());
119119
#ifdef CONFIG_SCHED_CPU_MASK
120-
k_thread_cpu_mask_clear(thread);
121-
k_thread_cpu_mask_enable(thread, PLATFORM_PRIMARY_CORE_ID);
120+
k_thread_cpu_pin(thread, PLATFORM_PRIMARY_CORE_ID);
122121
#endif
123122
k_thread_name_set(thread, "edf_workq");
124123

0 commit comments

Comments
 (0)