Skip to content

Commit e11e459

Browse files
biwenlijhedberg
authored andcommitted
drivers: firmware: scmi: add CONFIG_ARM_SCMI_CHAN_SEM_TIMEOUT_USEC
Add option CONFIG_ARM_SCMI_CHAN_SEM_TIMEOUT_USEC for users to change default timeout value. Different platform has different delay time when scmi agent get scmi response from scmi platform. Signed-off-by: Biwen Li <[email protected]>
1 parent a4450ed commit e11e459

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

drivers/firmware/scmi/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ config ARM_SCMI_TRANSPORT_INIT_PRIORITY
6464
help
6565
SCMI transport driver device initialization priority.
6666

67+
config ARM_SCMI_CHAN_SEM_TIMEOUT_USEC
68+
int "ARM SCMI channel semaphore timeout"
69+
default 500
70+
help
71+
Maximum number of microseconds to wait for a reply from the
72+
scmi platform.
73+
6774
source "drivers/firmware/scmi/nxp/Kconfig"
6875

6976
endif # ARM_SCMI

drivers/firmware/scmi/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
LOG_MODULE_REGISTER(scmi_core);
1414

1515
#define SCMI_CHAN_LOCK_TIMEOUT_USEC 500
16-
#define SCMI_CHAN_SEM_TIMEOUT_USEC 500
1716

1817
int scmi_status_to_errno(int scmi_status)
1918
{
@@ -180,7 +179,7 @@ static int scmi_send_message_interrupt(struct scmi_protocol *proto,
180179
}
181180

182181
/* only one protocol instance can wait for a message reply at a time */
183-
ret = k_sem_take(&proto->tx->sem, K_USEC(SCMI_CHAN_SEM_TIMEOUT_USEC));
182+
ret = k_sem_take(&proto->tx->sem, K_USEC(CONFIG_ARM_SCMI_CHAN_SEM_TIMEOUT_USEC));
184183
if (ret < 0) {
185184
LOG_ERR("failed to wait for msg reply");
186185
goto out_release_mutex;

0 commit comments

Comments
 (0)