From 8068b71c0b339316ab2d80405fcefaf380bf7199 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 15 Jan 2024 15:21:36 +0100 Subject: [PATCH] ace: fix DSP panic during startup pm_device_runtime_get() must be called after pd_intel_adsp_init() is called for each device, because the latter calls pm_device_runtime_enable(), which sets the device runtime PM use count to 0. The current wrong calling order causes a DSP panic because of an unbalanced pm_device_runtime_put(). Fix this by delaying pm_device_runtime_get() until the POST_KERNEL initialisation step. Fixes commit c3a6274bf5e4 ("intel_adsp: ace: power: Prevent HST domain power gating") Signed-off-by: Guennadi Liakhovetski (cherry picked from commit 4204ca9bcb3f675a0e63f647931ffe2c4b515729) --- soc/xtensa/intel_adsp/ace/multiprocessing.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/soc/xtensa/intel_adsp/ace/multiprocessing.c b/soc/xtensa/intel_adsp/ace/multiprocessing.c index c6f691a10b6996..eb94f84e3d12bf 100644 --- a/soc/xtensa/intel_adsp/ace/multiprocessing.c +++ b/soc/xtensa/intel_adsp/ace/multiprocessing.c @@ -80,14 +80,16 @@ void soc_mp_init(void) IDC[i].agents[0].ipc.ctl = BIT(0); /* IPCTBIE */ } - int ret = pm_device_runtime_get(INTEL_ADSP_HST_DOMAIN_DEV); - ARG_UNUSED(ret); - __ASSERT(ret == 0, "HST power domain resume operation failed."); - /* Set the core 0 active */ soc_cpus_active[0] = true; } +static int host_runtime_get(void) +{ + return pm_device_runtime_get(INTEL_ADSP_HST_DOMAIN_DEV); +} +SYS_INIT(host_runtime_get, POST_KERNEL, 99); + #ifdef CONFIG_ADSP_IMR_CONTEXT_SAVE /* * Called after exiting D3 state when context restore is enabled.