From 6b92206c4380c6b60f7d43a5498c1dbb2961be46 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Thu, 10 Aug 2023 12:07:34 +0200 Subject: [PATCH] ipc4: set_dx: ignoring logger status notifications Before HOST can request FW to enter D3 state, has to stop all pipelines. If it's done properly all possible source of IPC messages from FW to HOST are disabled. The only exception from this is logger. If logs are enabled FW will continue to produce new traces and eventually trigger threshold notification. This notification is not critical so we can skip it during D3 entry. The message will remain in the internal list and will be sent when the DSP wakes up. Signed-off-by: Tomasz Leman --- src/ipc/ipc-zephyr.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/ipc/ipc-zephyr.c b/src/ipc/ipc-zephyr.c index b917cd4b4668..49a448850a99 100644 --- a/src/ipc/ipc-zephyr.c +++ b/src/ipc/ipc-zephyr.c @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -112,8 +114,27 @@ static int ipc_device_suspend_handler(const struct device *dev, void *arg) } if (!list_is_empty(&ipc->msg_list)) { - tr_err(&ipc_tr, "there are queued IPC messages to be sent"); - ret = -EINPROGRESS; + struct list_item *slist; + struct ipc_msg *msg; + /* The only possible message that can be added during power transition procedure is + * SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS. + */ + const uint32_t exp_hdr = SOF_IPC4_NOTIF_HEADER(SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS); + bool only_buff_status = true; + + list_for_item(slist, &ipc->msg_list) { + msg = container_of(slist, struct ipc_msg, list); + + if (msg->header != exp_hdr) + only_buff_status = false; + } + + if (only_buff_status) { + tr_warn(&ipc_tr, "continuing D3 procedure with the msg in the queue"); + } else { + tr_err(&ipc_tr, "there are queued IPC messages to be sent"); + ret = -EINPROGRESS; + } } if (ret != 0)