Skip to content

Commit c63ca13

Browse files
rlubosdkalowsk
authored andcommitted
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 <[email protected]>
1 parent 452f2b1 commit c63ca13

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/openthread/openthread.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ int openthread_init(void)
295295
return 0;
296296
}
297297

298+
/* Start work queue for the OpenThread module */
299+
k_work_queue_start(&openthread_work_q, ot_stack_area,
300+
K_KERNEL_STACK_SIZEOF(ot_stack_area),
301+
OT_PRIORITY, &q_cfg);
302+
298303
openthread_mutex_lock();
299304

300305
otSysInit(0, NULL);
@@ -342,10 +347,6 @@ int openthread_init(void)
342347

343348
openthread_mutex_unlock();
344349

345-
/* Start work queue for the OpenThread module */
346-
k_work_queue_start(&openthread_work_q, ot_stack_area, K_KERNEL_STACK_SIZEOF(ot_stack_area),
347-
OT_PRIORITY, &q_cfg);
348-
349350
(void)k_work_submit_to_queue(&openthread_work_q, &openthread_work);
350351

351352
return error == OT_ERROR_NONE ? 0 : -EIO;

0 commit comments

Comments
 (0)