-
Notifications
You must be signed in to change notification settings - Fork 349
ll-schedule: fix tasks removed during execution #7138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Could we merge these two commits over two different days? So we have one run of daily test with just the first commit, which looks like a very big change. Also, compatibility with upstream Zephyr was just broken, some daily tests are already broken: https://github.com/thesofproject/sof/actions/runs/4228168969/jobs/7343348093 EDIT: |
|
converted back to draft: tests are still failing (real tests, not this timing out CI run https://sof-ci.01.org/sofpr/PR7138/build4066/devicetest/index.html), and I cannot for now figure out why. I'll need to debug later. |
|
SOFCI TEST |
Zephyr LL-scheduler is supposed to be able to handle tasks, removed or added while the scheduler is executing. However, there is a bug in that implementation. If the task, that is currently executing, is removed, its list head, that links it into the list of tasks, is initialised. So when trying to get a pointer to the next task we obtain a pointer to the same task. BugLink: thesofproject#7084 Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Task state shouldn't be modified by client code, it is fully managed by the scheduler. Setting task status to INIT after scheduling a task is wrong and for chain DMA it leads to a scheduler exception. Simply remove the offending line. BugLink: thesofproject#7084 Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
|
The single failure is a suspend-resume test https://sof-ci.01.org/sofpr/PR7138/build4166/devicetest/index.html?model=ADLP_RVP_SDW_IPC4ZPH&testcase=check-suspend-resume-with-playback |
| } | ||
|
|
||
| pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); | ||
| cd->chain_task.state = SOF_TASK_STATE_INIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also remove 'schedule_task_cancel(&cd->chain_task)' in 'chain_task_pause' ? I think after this change it will not be necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@makarukp this should be a separate PR, reverting that change - after this is merged
jsarha
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run multiple-suspend-resume test number of times on my upx-i11 with this PR and "hda: chain dma: cancel task before freeing it" reverted. I got one transient failure (but no crash), but on three other times the test was successful. So I guess this is a proper fix for the ll scheduler crashing problem.
Zephyr LL-scheduler is supposed to be able to handle tasks, removed or added while the scheduler is executing. However, there is a bug in that implementation. If the task, that is currently executing, is removed, its list head, that links it into the list of tasks, is initialised. So when trying to get a pointer to the next task we obtain a pointer to the same task.
BugLink: #7084