From 62b491c8bfae9dca45eeb43c485792e1721a8307 Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba Date: Fri, 11 Jul 2025 11:25:31 +0200 Subject: [PATCH] intel: Fix for Zephyr pre-wakeup latency calc bug Fix for Zephyr bug (?) introduced by this commit: https://github.com/zephyrproject-rtos/zephyr/pull/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. Signed-off-by: Serhiy Katsyuba --- app/boards/intel_adsp_ace15_mtpm.conf | 1 + app/boards/intel_adsp_ace20_lnl.conf | 1 + app/boards/intel_adsp_ace30_ptl.conf | 1 + app/boards/intel_adsp_ace30_ptl_sim.conf | 1 + app/boards/intel_adsp_ace30_wcl.conf | 1 + app/boards/intel_adsp_ace30_wcl_sim.conf | 1 + 6 files changed, 6 insertions(+) diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index 64661f10ab3c..bf8cc7068b71 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -113,6 +113,7 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y CONFIG_PM_DEVICE_SYSTEM_MANAGED=y CONFIG_PM_DEVICE_POWER_DOMAIN=y +CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y CONFIG_POWER_DOMAIN=y CONFIG_POWER_DOMAIN_INTEL_ADSP=y diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index 1c47e5027a1d..2d264293f66f 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -92,6 +92,7 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_POWER_DOMAIN=y CONFIG_PM_DEVICE_RUNTIME=y CONFIG_PM_DEVICE_SYSTEM_MANAGED=y +CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y CONFIG_POWER_DOMAIN=y CONFIG_POWER_DOMAIN_INTEL_ADSP=y diff --git a/app/boards/intel_adsp_ace30_ptl.conf b/app/boards/intel_adsp_ace30_ptl.conf index 0e12f23a8b93..6eac290aa74e 100644 --- a/app/boards/intel_adsp_ace30_ptl.conf +++ b/app/boards/intel_adsp_ace30_ptl.conf @@ -91,6 +91,7 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y CONFIG_PM_DEVICE_POWER_DOMAIN=y CONFIG_PM_DEVICE_SYSTEM_MANAGED=y +CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y CONFIG_POWER_DOMAIN=y CONFIG_POWER_DOMAIN_INTEL_ADSP=y diff --git a/app/boards/intel_adsp_ace30_ptl_sim.conf b/app/boards/intel_adsp_ace30_ptl_sim.conf index ef3f717f9082..34e771a5f2d3 100644 --- a/app/boards/intel_adsp_ace30_ptl_sim.conf +++ b/app/boards/intel_adsp_ace30_ptl_sim.conf @@ -57,6 +57,7 @@ CONFIG_INTEL_ADSP_IPC=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=n CONFIG_PM_DEVICE_POWER_DOMAIN=n +CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y CONFIG_COMP_KPB=n CONFIG_CLOCK_CONTROL_ADSP=y diff --git a/app/boards/intel_adsp_ace30_wcl.conf b/app/boards/intel_adsp_ace30_wcl.conf index 8da2738668a0..8776c099fa24 100644 --- a/app/boards/intel_adsp_ace30_wcl.conf +++ b/app/boards/intel_adsp_ace30_wcl.conf @@ -76,6 +76,7 @@ CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=y CONFIG_PM_DEVICE_POWER_DOMAIN=y CONFIG_PM_DEVICE_SYSTEM_MANAGED=y +CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y CONFIG_POWER_DOMAIN=y CONFIG_POWER_DOMAIN_INTEL_ADSP=y diff --git a/app/boards/intel_adsp_ace30_wcl_sim.conf b/app/boards/intel_adsp_ace30_wcl_sim.conf index 64cfb22acd27..6daec5544be8 100644 --- a/app/boards/intel_adsp_ace30_wcl_sim.conf +++ b/app/boards/intel_adsp_ace30_wcl_sim.conf @@ -56,6 +56,7 @@ CONFIG_INTEL_ADSP_IPC=y CONFIG_PM_DEVICE=y CONFIG_PM_DEVICE_RUNTIME=n CONFIG_PM_DEVICE_POWER_DOMAIN=n +CONFIG_PM_PREWAKEUP_CONV_MODE_CEIL=y CONFIG_COMP_KPB=n CONFIG_CLOCK_CONTROL_ADSP=y