From 946daa560b7baabfb9854d76cd00f836fe628ee3 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 17 Jan 2024 23:05:56 +0200 Subject: [PATCH] idc: zephyr: add a timeout to blocking IDC send 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 --- src/idc/zephyr_idc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idc/zephyr_idc.c b/src/idc/zephyr_idc.c index 887cff0eb375..d165ef9f19b2 100644 --- a/src/idc/zephyr_idc.c +++ b/src/idc/zephyr_idc.c @@ -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);