Skip to content

Commit ade7122

Browse files
committed
fixup! Bluetooth: Host: Add bt_taskq workqueue for quick non-blocking tasks
1 parent 8eb2dff commit ade7122

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
choice BT_TASKQ_CONTEXT
2+
prompt "bt_taskq thread selection"
3+
# nRF51 is too small to have a dedicated thread
4+
default BT_TASKQ_SYSTEM_WORKQUEUE if SOC_SERIES_NRF51X
5+
default BT_TASKQ_DEDICATED
6+
help
7+
Selects in which context the bt_taskq runs.
8+
9+
bt_taskq work is quick and non-blocking and must not be
10+
blocked by other work. It should be on a work queue that
11+
is exclusively for non-blocking work.
12+
13+
config BT_TASKQ_DEDICATED
14+
bool "Dedicated thread"
15+
help
16+
When this option is selected, the bt_taskq runs on a
17+
dedicated thread. This is the default and safe option.
18+
19+
config BT_TASKQ_SYSTEM_WORKQUEUE
20+
bool "System workqueue"
21+
help
22+
When this option is selected, the bt_taskq is the system
23+
workqueue.
24+
25+
WARNING: This is safe only if there is no blocking work on
26+
the system workqueue.
27+
28+
This is currently NEVER SAFE to use as the Host itself
29+
puts blocking work on the system workqueue. For now, this
30+
option exists for users that need to free up RAM by not
31+
having an extra thread and are willing to accept the risk
32+
of deadlocks. When using this option, it is advised to
33+
have a watchdog to recover from deadlocks. Risk of
34+
deadlocks can be mitigated by being mindful of buffers and
35+
whole-system analysis.
36+
37+
endchoice
38+
39+
menu "bt_taskq thread properties"
40+
depends on BT_TASKQ_DEDICATED
41+
42+
config BT_TASKQ_STACK_SIZE_WITH_PROMPT
43+
bool "Override BT taskq thread stack size"
44+
45+
config BT_TASKQ_STACK_SIZE
46+
int
47+
prompt "BT taskq thread stack size" if BT_TASKQ_STACK_SIZE_WITH_PROMPT
48+
default 1024
49+
50+
endmenu
51+
52+
config BT_TASKQ_THREAD_PRIO
53+
# Hidden option
54+
int
55+
# -1 is the least urgent cooperative priority.
56+
# tx_processor() needs a cooperative thread for now.
57+
default -1

0 commit comments

Comments
 (0)