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