Skip to content

Commit 0b03f4b

Browse files
alwa-nordicKyraLengfeld
authored andcommitted
[nrf fromtree] Bluetooth: Host: Disable bt_hci_cmd_send_sync workaround
The workaround in bt_cmd_send_sync should no longer by needed when tx_processor is not on the system work queue. Signed-off-by: Aleksander Wasaznik <[email protected]> (cherry picked from commit 04b8dba) Signed-off-by: Kyra Lengfeld <[email protected]>
1 parent 33a6572 commit 0b03f4b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,11 @@ int bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf *buf,
472472

473473
/* TODO: disallow sending sync commands from syswq altogether */
474474

475-
/* Since the commands are now processed in the syswq, we cannot suspend
476-
* and wait. We have to send the command from the current context.
475+
/* If the commands are processed in the syswq and we are on the
476+
* syswq, then we cannot suspend and wait. We have to send the
477+
* command from the current context.
477478
*/
478-
if (k_current_get() == &k_sys_work_q.thread) {
479+
if (!IS_ENABLED(CONFIG_BT_TX_PROCESSOR_THREAD) && k_current_get() == &k_sys_work_q.thread) {
479480
/* drain the command queue until we get to send the command of interest. */
480481
struct net_buf *cmd = NULL;
481482

0 commit comments

Comments
 (0)