From 4204ca9bcb3f675a0e63f647931ffe2c4b515729 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 --- soc/xtensa/intel_adsp/ace/multiprocessing.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/soc/xtensa/intel_adsp/ace/multiprocessing.c b/soc/xtensa/intel_adsp/ace/multiprocessing.c index 96c9d1ac3a1..d3a4bef4094 100644 --- a/soc/xtensa/intel_adsp/ace/multiprocessing.c +++ b/soc/xtensa/intel_adsp/ace/multiprocessing.c @@ -86,11 +86,6 @@ 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_NO_MSG(ret == 0); - /* Set the core 0 active */ soc_cpus_active[0] = true; #if CONFIG_ACE_VERSION_1_5 @@ -100,6 +95,12 @@ void soc_mp_init(void) #endif /* CONFIG_ACE_VERSION_1_5 */ } +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.