Skip to content

Commit d27fb85

Browse files
idc: Make IDC timeout value configurable
It may be beneficial to have different timeout values for fast platforms (manufactured silicon) and at least 10 times slower FPGA platforms. With the introduction of LLEXT modules, the time to free a module increased as log_flush() is called as part of module unloading. log_flush() takes 5 ms if at least one line of logs has to be flushed. Let's add these 5 ms to the previous 10 ms IDC timeout to have a default timeout of 15 ms. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
1 parent ba3e73f commit d27fb85

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

posix/include/rtos/idc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
/** \brief IDC send core power down flag. */
3535
#define IDC_POWER_DOWN 3
3636

37-
/** \brief IDC send timeout in microseconds. */
38-
#define IDC_TIMEOUT 10000
39-
4037
/** \brief IDC task deadline. */
4138
#define IDC_DEADLINE 100
4239

src/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ rsource "samples/Kconfig"
1717
rsource "schedule/Kconfig"
1818
rsource "schedule/Kconfig.threads_prio"
1919

20+
rsource "idc/Kconfig"
21+
2022
rsource "ipc/Kconfig"
2123

2224
rsource "math/Kconfig"

src/idc/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
config IDC_TIMEOUT_US
4+
int "Timeout for bloking IDC call, microseconds"
5+
default 15000
6+
help
7+
It may be beneficial to have different timeout values
8+
for fast platforms (manufactured silicon) and at least
9+
10 times slower FPGA platforms.

src/idc/zephyr_idc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode)
165165

166166
switch (mode) {
167167
case IDC_BLOCKING:
168-
ret = k_p4wq_wait(work, K_USEC(IDC_TIMEOUT));
168+
ret = k_p4wq_wait(work, K_USEC(CONFIG_IDC_TIMEOUT_US));
169169
if (!ret)
170170
/* message was sent and executed successfully, get status code */
171171
ret = idc_msg_status_get(msg->core);

zephyr/include/rtos/idc.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
/** \brief IDC send core power down flag. */
3535
#define IDC_POWER_DOWN 3
3636

37-
/** \brief IDC send timeout in microseconds. */
38-
#define IDC_TIMEOUT 10000
39-
4037
/** \brief IDC task deadline. */
4138
#define IDC_DEADLINE 100
4239

0 commit comments

Comments
 (0)