pm: policy: d0i3: wait for ipc ack before pg

The DSP cannot enter the power gating state if it has not yet received
an ack from host after sending an ipc message.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This commit is contained in:
Tomasz Leman 2023-05-15 14:49:13 +02:00 committed by Kai Vehmanen
parent 478cea5b3d
commit 9b4a618c52
2 changed files with 7 additions and 1 deletions

View File

@ -184,6 +184,11 @@ void ipc_platform_send_msg_direct(const struct ipc_msg *msg)
intel_adsp_ipc_send_message_emergency(INTEL_ADSP_IPC_HOST_DEV, hdr->pri, hdr->ext);
}
int ipc_platform_poll_is_host_ready(void)
{
return intel_adsp_ipc_is_complete(INTEL_ADSP_IPC_HOST_DEV);
}
int platform_ipc_init(struct ipc *ipc)
{
ipc_set_drvdata(ipc, NULL);

View File

@ -10,6 +10,7 @@
#include <sof_versions.h>
#include <stdint.h>
#include <zephyr/pm/policy.h>
#include <sof/ipc/driver.h>
LOG_MODULE_REGISTER(power, CONFIG_SOF_LOG_LEVEL);
@ -46,7 +47,7 @@ const struct pm_state_info *pm_policy_next_state(uint8_t cpu, int32_t ticks)
continue;
/* skipping when some ipc task is not finished */
if (ipc_get()->task_mask)
if (ipc_get()->task_mask || !ipc_platform_poll_is_host_ready())
continue;
}