Skip to content

Commit c3dd1e8

Browse files
rugeGerritsenaescolar
authored andcommitted
Bluetooth: Host: Fix bt_disable() for IPC giving HCI Reset timeout
Some HCI drivers issue HCI reset when disabling, like the IPC HCI driver. We need to keep the RX thread running to allow receiving the command complete. This commit postpones aborting the RX thread until this is done. The issue happens started occuring after commit d0e75ab87c4b53d66008c941c38709a2fca9dbea. Fixes #76202. Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
1 parent d6afb8f commit c3dd1e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4329,11 +4329,6 @@ int bt_disable(void)
43294329
disconnected_handles_reset();
43304330
#endif /* CONFIG_BT_CONN */
43314331

4332-
#if defined(CONFIG_BT_RECV_WORKQ_BT)
4333-
/* Abort RX thread */
4334-
k_thread_abort(&bt_workq.thread);
4335-
#endif
4336-
43374332
#if DT_HAS_CHOSEN(zephyr_bt_hci)
43384333
err = bt_hci_close(bt_dev.hci);
43394334
if (err == -ENOSYS) {
@@ -4353,6 +4348,11 @@ int bt_disable(void)
43534348
return err;
43544349
}
43554350

4351+
#if defined(CONFIG_BT_RECV_WORKQ_BT)
4352+
/* Abort RX thread */
4353+
k_thread_abort(&bt_workq.thread);
4354+
#endif
4355+
43564356
/* Some functions rely on checking this bitfield */
43574357
memset(bt_dev.supported_commands, 0x00, sizeof(bt_dev.supported_commands));
43584358

0 commit comments

Comments
 (0)