Skip to content

Commit

Permalink
zephyr: ll-schedule: restore clock after idle in scheduler
Browse files Browse the repository at this point in the history
The adsp_clock_idle_exit function is invoked at the beginning of the
scheduler thread function to reset the clock frequency if it was lowered
during idle periods. This change is crucial for maintaining the
performance and responsiveness of the system when it resumes work after
being idle.

This patch is conditionally compiled with
CONFIG_ADSP_DYNAMIC_CLOCK_SWITCHING to ensure that the functionality is
available only on systems that support dynamic clock management.

Signed-off-by: Tomasz Leman <[email protected]>
  • Loading branch information
tmleman committed Jan 11, 2024
1 parent e47272c commit 83bde8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/schedule/zephyr_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ static void zephyr_domain_thread_fn(void *p1, void *p2, void *p3)
#endif

cycles0 = k_cycle_get_32();
#if CONFIG_ADSP_DYNAMIC_CLOCK_SWITCHING
/* If the DSP has been in Idle we may need to restore previous clock. */
adsp_clock_idle_exit();
#endif
dt->handler(dt->arg);
cycles1 = k_cycle_get_32();

Expand Down

0 comments on commit 83bde8c

Please sign in to comment.