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 <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2024-01-17 23:05:56 +02:00 committed by Kai Vehmanen
parent 83f69f144f
commit b97f81a36a
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode)
switch (mode) { switch (mode) {
case IDC_BLOCKING: case IDC_BLOCKING:
ret = k_p4wq_wait(work, K_FOREVER); ret = k_p4wq_wait(work, K_USEC(IDC_TIMEOUT));
if (!ret) if (!ret)
/* message was sent and executed successfully, get status code */ /* message was sent and executed successfully, get status code */
ret = idc_msg_status_get(msg->core); ret = idc_msg_status_get(msg->core);