Skip to content

zephyr: remove k_thread_cpu_mask_clear() calls#11002

Closed
serhiy-katsyuba-intel wants to merge 1 commit into
thesofproject:mainfrom
serhiy-katsyuba-intel:fix_cpu_mask_clear
Closed

zephyr: remove k_thread_cpu_mask_clear() calls#11002
serhiy-katsyuba-intel wants to merge 1 commit into
thesofproject:mainfrom
serhiy-katsyuba-intel:fix_cpu_mask_clear

Conversation

@serhiy-katsyuba-intel

Copy link
Copy Markdown
Contributor

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.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents Zephyr boot-time assertions when CONFIG_SCHED_CPU_MASK_PIN_ONLY is enabled by removing k_thread_cpu_mask_clear() (which can produce an invalid empty CPU mask) and replacing the previous “clear + enable one CPU” sequence with k_thread_cpu_pin() to bind threads to a specific core.

Changes:

  • Pin the EDF workqueue thread to PLATFORM_PRIMARY_CORE_ID using k_thread_cpu_pin().
  • Pin low-latency (LL) domain threads to their target core using k_thread_cpu_pin().
  • Pin DMA domain threads to their target core using k_thread_cpu_pin().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
zephyr/edf_schedule.c Pins the EDF workqueue thread to the primary core without clearing the CPU mask.
src/schedule/zephyr_domain.c Pins LL domain threads to the selected core using k_thread_cpu_pin().
src/schedule/zephyr_dma_domain.c Pins DMA domain thread to the selected core using k_thread_cpu_pin().

@kv2019i

kv2019i commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

@serhiy-katsyuba-intel I think this is a duplicate of #10953 . We should get one of these in though.

@serhiy-katsyuba-intel

Copy link
Copy Markdown
Contributor Author

Closed in favor of #10953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants