Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Bluetooth: hci_core: Refactor HCI reset functions
@ 2026-05-26 13:50 Heitor Alves de Siqueira
  2026-05-26 13:50 ` [PATCH v2 1/3] Bluetooth: hci_core: Rework hci_dev_do_reset() to use hci_sync functions Heitor Alves de Siqueira
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Heitor Alves de Siqueira @ 2026-05-26 13:50 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Gustavo Padovan,
	Schspa Shi
  Cc: linux-bluetooth, linux-kernel, kernel-dev,
	Heitor Alves de Siqueira, Luiz Augusto von Dentz

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@igalia.com>
---
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@igalia.com

To: Marcel Holtmann <marcel@holtmann.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Schspa Shi <schspa@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
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@igalia.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-05-27 20:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 13:50 [PATCH v2 0/3] Bluetooth: hci_core: Refactor HCI reset functions Heitor Alves de Siqueira
2026-05-26 13:50 ` [PATCH v2 1/3] Bluetooth: hci_core: Rework hci_dev_do_reset() to use hci_sync functions Heitor Alves de Siqueira
2026-05-26 14:57   ` Bluetooth: hci_core: Refactor HCI reset functions bluez.test.bot
2026-05-26 13:50 ` [PATCH v2 2/3] Bluetooth: hci_sync: Set HCI_CMD_DRAIN_WORKQUEUE during device close Heitor Alves de Siqueira
2026-05-26 13:50 ` [PATCH v2 3/3] Bluetooth: hci_sync: Reset device counters in hci_dev_close_sync() Heitor Alves de Siqueira
2026-05-27 20:50 ` [PATCH v2 0/3] Bluetooth: hci_core: Refactor HCI reset functions patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox