schedule: ll: handle completed task state in library scheduler - #11128
Merged
Conversation
Update the library LL scheduler in schedule_ll_run_tasks() to check the task_run() return state and remove tasks returning SOF_TASK_STATE_COMPLETED from the scheduler list. Following commit 002e499 ("ipc4: pipeline: split trigger and copy processing"), IPC4 uses a one-shot trigger task that returns SOF_TASK_STATE_COMPLETED upon trigger completion, while the copy task waits for task_is_active(p->trigger_task) to clear before copying. Previously, the library LL scheduler ignored the return value of task_run() and reset the task state back to SOF_TASK_STATE_QUEUED, leaving trigger_task permanently active and causing testbench pipeline copy tasks to stall indefinitely. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
singalsu
marked this pull request as ready for review
August 25, 2026 15:51
singalsu
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
August 25, 2026 15:51
serhiy-katsyuba-intel
approved these changes
Aug 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the testbench/library low-latency (LL) scheduler to respect a task’s task_run() return state, specifically removing tasks that report SOF_TASK_STATE_COMPLETED from the scheduler list. This aligns the library scheduler behavior with IPC4’s one-shot trigger tasks so completed triggers don’t remain “active” and block dependent copy tasks in the testbench.
Changes:
- Capture
task_run()return state inschedule_ll_run_tasks()and delete tasks that returnSOF_TASK_STATE_COMPLETEDfromsched_list. - Prevent re-scheduling tasks that are already queued/running in
schedule_ll_task(). - Adjust cancel/free behavior to avoid deleting a task list node unless it is considered scheduled.
Suppressed comments (1)
src/platform/library/schedule/ll_schedule.c:101
- schedule_ll_task_free() has the same active-state gap as schedule_ll_task_cancel(): tasks freed from states other than QUEUED/RUNNING would stay linked on sched_list. Using task_is_active() ensures all active states are unlinked safely.
if (task->state == SOF_TASK_STATE_QUEUED ||
task->state == SOF_TASK_STATE_RUNNING)
list_item_del(&task->list);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+64
to
+66
| if (task->state == SOF_TASK_STATE_QUEUED || | ||
| task->state == SOF_TASK_STATE_RUNNING) | ||
| return 0; |
Comment on lines
+86
to
+88
| if (task->state == SOF_TASK_STATE_QUEUED || | ||
| task->state == SOF_TASK_STATE_RUNNING) | ||
| list_item_del(&task->list); |
kv2019i
approved these changes
Aug 26, 2026
Collaborator
|
Merged quickly as this was blocking testbench testing in CI and causing longrunning CI jobs running for hours... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the library LL scheduler in schedule_ll_run_tasks() to check the task_run() return state and remove tasks returning SOF_TASK_STATE_COMPLETED from the scheduler list.
Following commit 002e499 ("ipc4: pipeline: split trigger and copy processing"), IPC4 uses a one-shot trigger task that returns SOF_TASK_STATE_COMPLETED upon trigger completion, while the copy task waits for task_is_active(p->trigger_task) to clear before copying. Previously, the library LL scheduler ignored the return value of task_run() and reset the task state back to SOF_TASK_STATE_QUEUED, leaving trigger_task permanently active and causing testbench pipeline copy tasks to stall indefinitely.