From c63ca134c60d907812794dd7ad6d81e244c249cf Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Thu, 5 Jun 2025 15:55:46 +0200 Subject: [PATCH] net: openthread: Fix tasklet error printed on boot OpenThread tries to signal pending tasklets during initialization, which currently generate an error, as the work queue configured to handle tasklets is initialized later. This is not a fatal issue, as the initialization code on the Zephyr side triggers a work item immediately after the work queue was initialized, but it doesn't look good to have errors printed on boot. Therefore, move the work queue initialization before the OpenThread stack initialization, so that tasklets triggered from OT side can be signalled properly w/o an error. Signed-off-by: Robert Lubos --- modules/openthread/openthread.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/openthread/openthread.c b/modules/openthread/openthread.c index 5bd7f27e8c8..40ddce50319 100644 --- a/modules/openthread/openthread.c +++ b/modules/openthread/openthread.c @@ -295,6 +295,11 @@ int openthread_init(void) return 0; } + /* Start work queue for the OpenThread module */ + k_work_queue_start(&openthread_work_q, ot_stack_area, + K_KERNEL_STACK_SIZEOF(ot_stack_area), + OT_PRIORITY, &q_cfg); + openthread_mutex_lock(); otSysInit(0, NULL); @@ -342,10 +347,6 @@ int openthread_init(void) openthread_mutex_unlock(); - /* Start work queue for the OpenThread module */ - k_work_queue_start(&openthread_work_q, ot_stack_area, K_KERNEL_STACK_SIZEOF(ot_stack_area), - OT_PRIORITY, &q_cfg); - (void)k_work_submit_to_queue(&openthread_work_q, &openthread_work); return error == OT_ERROR_NONE ? 0 : -EIO;