[PATCH v2 0/3] Bluetooth: hci_core: Refactor HCI reset functions

From: Heitor Alves de Siqueira

Date: Tue May 26 2026 - 09:53:01 EST


Dear maintainers,

While investigating some warnings reported by syzbot on the hdev
workqueue, Luiz kindly mentioned the possibility of reworking the reset
functions in hci_core. A lot of the work done "manually" in
hci_dev_do_reset() is already handled by the close/open functions in
hci_sync, and those also handle missing functionality related to LE,
discovery and advertising.

This series removes most of the code in hci_dev_do_reset() in favor of
calling hci_dev_close_sync() and hci_dev_open_sync(). The two follow-up
patches are minor fixes porting over a device flag for indicating when
the workqueue is being drained, and another for zeroing device counters.
Although I've left them as individual commits, they could probably be
squashed together if that's preferrable.

I've tested this using the Bluez HCI emulator and corresponding tester
tools, as well as on a generic USB Bluetooth dongle. No regressions were
reported by l2cap-tester, mgmt-tester and hci-tester.

Signed-off-by: Heitor Alves de Siqueira <halves@xxxxxxxxxx>
---
Changes in v2:
- Removed most reset code from hci_dev_do_reset(), in favor of
hci_dev_close_sync() and hci_dev_open_sync()
- Added HCI_CMD_DRAIN_WORKQUEUE to hci_dev_close_sync(), as it's now
used in the reset path
- Included a minor fix for zeroing protocol counters
- Link to v1: https://patch.msgid.link/20260513-hci_send-v1-1-ae3eef758280@xxxxxxxxxx

To: Marcel Holtmann <marcel@xxxxxxxxxxxx>
To: Luiz Augusto von Dentz <luiz.dentz@xxxxxxxxx>
To: Schspa Shi <schspa@xxxxxxxxx>
Cc: linux-bluetooth@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

---
Heitor Alves de Siqueira (3):
Bluetooth: hci_core: Rework hci_dev_do_reset() to use hci_sync functions
Bluetooth: hci_sync: Set HCI_CMD_DRAIN_WORKQUEUE during device close
Bluetooth: hci_sync: Reset device counters in hci_dev_close_sync()

net/bluetooth/hci_core.c | 43 +++----------------------------------------
net/bluetooth/hci_sync.c | 12 ++++++++++++
2 files changed, 15 insertions(+), 40 deletions(-)
---
base-commit: 8bc67e4db64aa72732c474b44ea8622062c903f0
change-id: 20260513-hci_send-640290de7acc

Best regards,
--
Heitor Alves de Siqueira <halves@xxxxxxxxxx>