Skip to content

subset of #10945#10984

Open
lyakh wants to merge 7 commits into
thesofproject:mainfrom
lyakh:user-prelim
Open

subset of #10945#10984
lyakh wants to merge 7 commits into
thesofproject:mainfrom
lyakh:user-prelim

Conversation

@lyakh

@lyakh lyakh commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Several commits from #10945 that can be merged now

lyakh added 7 commits July 10, 2026 10:26
set_processing_mode() and get_processing_mode() methods of struct
module_interface aren't unused, they are used by IADK. Fix respective
comments.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
scheduler_is_user() should return true for DP as well.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
schedule_free() is only called from testbench and stand-alone ztest.
Remove it and all scheduler .scheduler_free() methods for all other
builds. Also fix memory leaks in the Zephyr LL version.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When running the LL scheduler in userspace, it can happen that no
kernel-mode schedulers get registered on a running secondary core.
To recognise such cases add a check for userspace schedulers to
check_restore().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Make ll_sch_is_current() available for builds with
CONFIG_COLD_STORE_EXECUTE_DEBUG unselected.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When LL runs in userspace, multiple DP functions are called in
userspace mode too. They cannot use privileged instructions then.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The LL tick task's .priv_data pointer has to be NULL for the check in
zephyr_ll_task_init() to pass.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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 cherry-picks a subset of changes from #10945 to unblock parts of the userspace scheduling work (Zephyr LL/DP scheduling and related init/teardown paths), including DP scheduler multicore fixes and conditional scheduler teardown helpers for standalone/library environments.

Changes:

  • Adjust scheduling infrastructure for userspace-managed schedulers (mark DP as userspace-managed; update secondary-core restore check to consider user scheduler lists).
  • Fix DP scheduler locking to use the task’s target core, and harden DP init state for repeated init scenarios.
  • Gate scheduler_free support behind CONFIG_SOF_BOOT_TEST_STANDALONE || CONFIG_LIBRARY across multiple scheduler implementations.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
zephyr/include/sof/lib/memory.h Reorders cold-store debug include block relative to Zephyr-only ll_sch_is_current() declaration.
src/schedule/zephyr_ll.c Adds conditional scheduler_free implementation and wires it into ops only for standalone/library builds.
src/schedule/zephyr_dp_schedule.c Uses task->core for per-core DP locking; initializes ll_tick_src.priv_data.
src/schedule/schedule.c Treats DP scheduler type as “userspace-managed” when userspace LL is enabled.
src/schedule/ll_schedule_xtos.c Conditionally exposes LL scheduler_free in ops for standalone/library builds.
src/platform/library/schedule/ll_schedule.c Conditionally exposes library LL scheduler_free in ops for standalone/library builds.
src/platform/library/schedule/edf_schedule.c Conditionally exposes library EDF scheduler_free in ops for standalone/library builds.
src/init/init.c Restore detection now accepts either kernel schedulers or user schedulers as “already allocated”.
src/include/sof/schedule/schedule.h Conditionally compiles scheduler_free API/inline wrapper for standalone/library builds.
src/include/module/module/interface.h Updates comments on processing-mode hooks.

Comment thread src/schedule/schedule.c
* kernel
*/
return type == SOF_SCHEDULE_LL_TIMER;
return type == SOF_SCHEDULE_LL_TIMER || type == SOF_SCHEDULE_DP;
Comment on lines 145 to 146
* Frees scheduler's resources.
* @param data Private data of selected scheduler.
@lgirdwood

Copy link
Copy Markdown
Member

@lyakh some build errors.

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.

3 participants