Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport v3.7-branch] bug-fix: RTIO Workqueue working during Device Initialization #85902

Open
wants to merge 2 commits into
base: v3.7-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/os/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ config MPSC_CLEAR_ALLOCATED
When enabled packet space is zeroed before returning from allocation.
endif

if SCHED_DEADLINE

config P4WQ_INIT_STAGE_EARLY
bool "Early initialization of P4WQ threads"
help
Initialize P4WQ threads early so that the P4WQ can be used on devices
initialization sequence.

endif

config REBOOT
bool "Reboot functionality"
help
Expand Down
4 changes: 4 additions & 0 deletions lib/os/p4wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ void k_p4wq_enable_static_thread(struct k_p4wq *queue, struct k_thread *thread,
* so they can initialize in parallel instead of serially on the main
* CPU.
*/
#if defined(CONFIG_P4WQ_INIT_STAGE_EARLY)
SYS_INIT(static_init, POST_KERNEL, 1);
#else
SYS_INIT(static_init, APPLICATION, 99);
#endif

void k_p4wq_submit(struct k_p4wq *queue, struct k_p4wq_work *item)
{
Expand Down
1 change: 1 addition & 0 deletions subsys/rtio/Kconfig.workq
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
config RTIO_WORKQ
bool "RTIO Work-queues service to process Sync operations"
select SCHED_DEADLINE
select P4WQ_INIT_STAGE_EARLY
select RTIO_CONSUME_SEM
help
Enable RTIO Work-queues to allow processing synchronous operations
Expand Down
Loading