Skip to content

Commit

Permalink
idc: zephyr: add a timeout to blocking IDC send
Browse files Browse the repository at this point in the history
Replace infinite wait with a time-limited wait. In case a blocking
IDC message is not handled within IDC_TIMEOUT, return an error
instead of waiting. This allows to debug stuck core-to-core communication
easier.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
  • Loading branch information
kv2019i committed Mar 6, 2024
1 parent 7507b32 commit 946daa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/idc/zephyr_idc.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode)

switch (mode) {
case IDC_BLOCKING:
ret = k_p4wq_wait(work, K_FOREVER);
ret = k_p4wq_wait(work, K_USEC(IDC_TIMEOUT));
if (!ret)
/* message was sent and executed successfully, get status code */
ret = idc_msg_status_get(msg->core);
Expand Down

0 comments on commit 946daa5

Please sign in to comment.