Skip to content

scheduler: zephyr_ll: misc fixes to make scheduler run in user-space#10824

Open
kv2019i wants to merge 2 commits into
thesofproject:mainfrom
kv2019i:202605-ll-scheduler-misc
Open

scheduler: zephyr_ll: misc fixes to make scheduler run in user-space#10824
kv2019i wants to merge 2 commits into
thesofproject:mainfrom
kv2019i:202605-ll-scheduler-misc

Conversation

@kv2019i
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i commented May 28, 2026

A few standalone changes to make LL scheduler code user-space safe.

kv2019i added 2 commits May 28, 2026 18:24
Don't use sof_cycle_get_64() if SOF built for user-space LL.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
No need to check whether we are running in ISR as this can never
happen when LL scheduler is run in user-space.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Comment thread src/schedule/zephyr_ll.c
if (k_is_in_isr()) {
tr_err(&ll_tr, "cannot free tasks from interrupt context!");
return -EDEADLK;
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Although @lyakh , I do wonder if this check makes sense for any build anymore. This has been in place since your original commit a439ea9

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 aims to make the Zephyr low-latency (LL) scheduler and related timing code safe to run in Zephyr user-space builds (CONFIG_SOF_USERSPACE_LL), avoiding kernel-only APIs in those configurations.

Changes:

  • Switch DAI wallclock retrieval to a user-space-safe time source under CONFIG_SOF_USERSPACE_LL.
  • Avoid calling k_is_in_isr() in zephyr_ll_task_free() when building for user-space.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
zephyr/wrapper.c Adjusts DAI wallclock source for user-space builds.
src/schedule/zephyr_ll.c Skips ISR-context check when compiled for user-space LL scheduler.

Comment thread zephyr/wrapper.c
Comment on lines +268 to +272
#ifndef CONFIG_SOF_USERSPACE_LL
*wallclock = sof_cycle_get_64();
#else
*wallclock = k_uptime_get();
#endif
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented May 28, 2026

For context, part of #10558

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.

2 participants