Bluetooth: hci_core: Refactor HCI reset functions
Status from this message: This series was applied to bluetooth/bluetooth-next.git (master)
Get series with b4
b4 am [email protected] change-id 20260513-hci_send-640290de7accVersions newest first
- v2 Latest3 patches 1 replyApplied 3/3
- v11 patch 7 repliesSuperseded
Changes in v2 from the cover letter
- 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/[email protected]
Patches in v2 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | Bluetooth: hci_core: Rework hci_dev_do_reset() to use hci_sync functionsnet/ | +3 | 1 reply | Applied |
| 2/3 | Bluetooth: hci_sync: Set HCI_CMD_DRAIN_WORKQUEUE during device closenet/ | +8 | 0 replies | Applied |
| 3/3 | Bluetooth: hci_sync: Reset device counters in hci_dev_close_sync()net/ | +4 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] Bluetooth: hci_core: Refactor HCI reset functions
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.
---
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/[email protected]
To: Marcel Holtmann <[email protected]>
To: Luiz Augusto von Dentz <[email protected]>
To: Schspa Shi <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Luiz Augusto von Dentz <[email protected]>
---
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,
Signature · 1 line
Heitor Alves de Siqueira <[email protected]>