intel: Fix for Zephyr pre-wakeup latency calc bug #10112
Merged
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.
Fix for Zephyr bug (?) introduced by this commit:
zephyrproject-rtos/zephyr#88145
Before that commit, the conversion of wakeup exit latency from us to ticks was done using the k_us_to_ticks_ceil32() function. After that commit, it was done with k_us_to_ticks_near32().
ACE has a 100 us exit latency declared in the device tree. A tick is about 83.3 us. Before that commit, the exit latency was calculated as 2 ticks; after the commit, it was calculated as 1 tick.
This created a sporadic problem in HDA loopback tests: proper audio was sent to the HDA output link, but silent samples were read from the HDA input link. It seems that running the LL too early, before all hardware parts have completely woken up, results in samples being zeroed by the hardware.
This commit restores the correct us to ticks conversion behavior by forcing the use of k_us_to_ticks_ceil32() for conversion.