Skip to content

schedule: dp: do not set the DP thread deadline from the LL user thread - #11486

Merged
kv2019i merged 1 commit into
thesofproject:mainfrom
kv2019i:202611-fix-dp-set-deadline
Nov 18, 2026
Merged

kv2019i merged 1 commit into
thesofproject:mainfrom
kv2019i:202611-fix-dp-set-deadline

Conversation

@kv2019i

@kv2019i kv2019i commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

With CONFIG_SOF_USERSPACE_LL, scheduler_dp_recalculate() runs in the LL user thread, which has no permission on the DP thread objects. Starting a capture with a DP module, e.g. the DP SRC in sof-ptl-nocodec, oopses the LL thread:

os.z_vrfy_k_thread_absolute_deadline_set: syscall
z_vrfy_k_thread_absolute_deadline_set failed check: access denied

The commit that added scheduler_dp_kick() left the direct k_thread_absolute_deadline_set() call in place, using the thread pointer from task memory. scheduler_dp_kick() already sets the deadline from the kernel-only task record, so drop the direct call.

The same commit also converted the deadline from ms to cycles a second time when computing the relative deadline passed to scheduler_dp_kick(), and dropped the update of deadline_clock_ticks that the DP deadline miss telemetry relies on. Pass the already converted value and restore the deadline_clock_ticks update.

Fixes: 20c417d ("schedule: dp: add scheduler_dp_kick() for applying DP scheduling results")

With CONFIG_SOF_USERSPACE_LL, scheduler_dp_recalculate() runs in the LL
user thread, which has no permission on the DP thread objects. Starting
a capture with a DP module, e.g. the DP SRC in sof-ptl-nocodec, oopses
the LL thread:

  os.z_vrfy_k_thread_absolute_deadline_set: syscall
  z_vrfy_k_thread_absolute_deadline_set failed check: access denied

The commit that added scheduler_dp_kick() left the direct
k_thread_absolute_deadline_set() call in place, using the thread pointer
from task memory. scheduler_dp_kick() already sets the deadline from the
kernel-only task record, so drop the direct call.

The same commit also converted the deadline from ms to cycles a second
time when computing the relative deadline passed to scheduler_dp_kick(),
and dropped the update of deadline_clock_ticks that the DP deadline miss
telemetry relies on. Pass the already converted value and restore the
deadline_clock_ticks update.

Fixes: 20c417d ("schedule: dp: add scheduler_dp_kick() for applying DP scheduling results")
Signed-off-by: Kai Vehmanen <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 14:12
@kv2019i

kv2019i commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

This seems to be a merge conflict with #11407 . We should have caught this in testing of #11440 but for some reason the CI tests did not catch this. Separate investigation ongoing why a pass was reported.

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.

🟢 Approval recommended

No active review issues remain for the DP scheduler deadline-handling changes.

No open issues 🎉

What changed in this PR

Fixes DP deadline handling in the audio scheduler to avoid thread-permission failures when starting DP modules from the userspace LL thread.

Changes:

  • Removes the direct thread deadline update, leaving it to the kernel-side scheduler_dp_kick().
  • Passes the already-converted cycle deadline without converting it again.
  • Restores deadline tracking for newly triggered tasks to support deadline-miss telemetry.
File Description
src/​schedule/​zephyr_dp_schedule_application.c Corrects deadline dispatch and conversion, and restores telemetry deadline tracking.

Review effort: Balanced

@intel-sofci

Copy link
Copy Markdown

PR 11486: test results

Run date: 2026-11-18 14:49 UTC

Tested commit: 4f11c63b6f5cd4583666fe99a8c6b22dbcd627f6

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@kv2019i

kv2019i commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

This fixing a regression impacting other PRs, tests look good, so proceeding with merge. Sorry for the short review time.

@kv2019i
kv2019i merged commit 6f356a4 into thesofproject:main Nov 18, 2026
45 checks passed
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.

5 participants