From 7d54586751cfe405d2cdcfd850f8100bc9844f63 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Wed, 17 May 2023 13:10:38 +0200 Subject: [PATCH] soc: intel_adsp: ipc: check for pending ack This patch modifies intel_adsp_ipc_is_complete function so it don't report that IPC is completed when we are still waiting for ACK from HOST. This change will allow to solve the problem that occurs during the power state transitions. Occasionally, the Application decides to enter the power gating state after sending an IPC message, before receiving an ACK from the HOST. This results in broken IPC communication when coming back to Idle state. Signed-off-by: Tomasz Leman --- soc/xtensa/intel_adsp/common/ipc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/soc/xtensa/intel_adsp/common/ipc.c b/soc/xtensa/intel_adsp/common/ipc.c index 74eb22ad8d0..c7adabe01ca 100644 --- a/soc/xtensa/intel_adsp/common/ipc.c +++ b/soc/xtensa/intel_adsp/common/ipc.c @@ -119,8 +119,10 @@ void intel_adsp_ipc_complete(const struct device *dev) bool intel_adsp_ipc_is_complete(const struct device *dev) { const struct intel_adsp_ipc_config *config = dev->config; + const struct intel_adsp_ipc_data *devdata = dev->data; + bool not_busy = (config->regs->idr & INTEL_ADSP_IPC_BUSY) == 0; - return (config->regs->idr & INTEL_ADSP_IPC_BUSY) == 0; + return not_busy && !devdata->tx_ack_pending; } bool intel_adsp_ipc_send_message(const struct device *dev,