From c142b7dff402482f87776cb00b2cf29413497723 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Thu, 18 Jan 2024 12:56:29 +0800 Subject: [PATCH] Revert "ipc4: relax the IPC timeout checks and be nicer to other threads" When a stream is triggered to start, host kernel first sendis trigger start ipc message to fw and then start host dma for this stream. Ipc_wait_for_compound_msg is used to wait for all pipelines in the stream to be complete and need to be done fast since it blocks host to start hda dma. The reverted commit adds a 10 ms delay and results to host copier xrun warning for it can't get data from host dma. And this commit also makes a negative effect for stream_start_offset calculation which is for the difference between dai gateway and host gateway. We calculate it in host start function but host dma is started 10ms later, so there will be at least 10ms data error. This reverts commit 909a3277f1271d91314736fc1eaff35f362176d1. Signed-off-by: Rander Wang --- src/ipc/ipc4/handler.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index e70fd4e278d0..f36504989e69 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -510,13 +510,12 @@ static void ipc_compound_msg_done(uint32_t msg_id, int error) } } -/* wait for IPCs to complete on other cores and be nice to any LL work */ static int ipc_wait_for_compound_msg(void) { - int try_count = 30; /* timeout out is 30 x 10ms so 300ms for IPC */ + int try_count = 30; while (atomic_read(&msg_data.delayed_reply)) { - k_sleep(Z_TIMEOUT_MS(10)); + k_sleep(Z_TIMEOUT_US(250)); if (!try_count--) { atomic_set(&msg_data.delayed_reply, 0);