Skip to content

Commit

Permalink
ipc4: relax the IPC timeout checks and be nicer to other threads
Browse files Browse the repository at this point in the history
No need to check every 250uS for ipc completion, relax this to avoid
any busy scheduling.

Signed-off-by: Liam Girdwood <[email protected]>
  • Loading branch information
lrgirdwo authored and lgirdwood committed Aug 3, 2023
1 parent 916e31f commit 909a327
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,16 @@ 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;
int try_count = 30; /* timeout out is 30 x 10ms so 300ms for IPC */

while (atomic_read(&msg_data.delayed_reply)) {
k_sleep(Z_TIMEOUT_US(250));
k_sleep(Z_TIMEOUT_MS(10));

if (!try_count--) {
ipc_cmd_err(&ipc_tr, "failed to wait schedule thread");
ipc_cmd_err(&ipc_tr, "ipc4: failed to wait schedule thread");
return IPC4_FAILURE;
}
}
Expand Down

0 comments on commit 909a327

Please sign in to comment.