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 <tomasz.m.leman@intel.com>
This commit is contained in:
Tomasz Leman 2023-05-17 13:10:38 +02:00 committed by Anas Nashif
commit 7d54586751

View file

@ -119,8 +119,10 @@ void intel_adsp_ipc_complete(const struct device *dev)
bool intel_adsp_ipc_is_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_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, bool intel_adsp_ipc_send_message(const struct device *dev,