Skip to content

Bluetooth: HCI command synchronization

Luiz Augusto von Dentz linux-bluetooth 9 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest23 patches 1 replyIn review
  2. v723 patches 0 repliesSuperseded
  3. v623 patches 0 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v523 patches0 repliesSuperseded
v47 patches1 replySuperseded
v3 posting 2/21 of 6 patches1 replySuperseded
v3 posting 1/26 patches1 replySuperseded
v25 patches1 replySuperseded
v15 patches1 replySuperseded

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23Bluetooth: Add helper for serialized HCI command executioninclude/net/bluetooth/hci_core.h include/net/bluetooth/hci_sync.h net/bluetooth/Makefile +4 more+385 -950 replies
2/23Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 1include/net/bluetooth/hci_sync.h net/bluetooth/hci_request.c net/bluetooth/hci_request.h +4 more+193 -1020 replies
3/23Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2include/net/bluetooth/bluetooth.h include/net/bluetooth/hci_sync.h net/bluetooth/hci_event.c +2 more+1158 -2020 replies
4/23Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3include/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+634 -40 replies
5/23Bluetooth: hci_sync: Enable advertising when LL privacy is enabledinclude/net/bluetooth/hci_core.h include/net/bluetooth/hci_sync.h net/bluetooth/hci_event.c +3 more+213 -1300 replies
6/23Bluetooth: hci_sync: Rework background scannet/bluetooth/hci_conn.c net/bluetooth/hci_core.c net/bluetooth/hci_event.c +3 more+26 -170 replies
7/23Bluetooth: hci_sync: Convert MGMT_SET_POWEREDinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_core.c net/bluetooth/hci_request.c +2 more+685 -980 replies
8/23Bluetooth: hci_sync: Convert MGMT_OP_START_DISCOVERYinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_conn.c net/bluetooth/hci_event.c +2 more+310 -560 replies
9/23Bluetooth: hci_sync: Convert MGMT_OP_SET_FAST_CONNECTABLEinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+33 -410 replies
10/23Bluetooth: hci_sync: Enable synch'd set_bredrinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+37 -380 replies
11/23Bluetooth: hci_sync: Convert MGMT_OP_GET_CONN_INFOinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+79 -900 replies
12/23Bluetooth: hci_sync: Convert MGMT_OP_SET_SECURE_CONNinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+49 -360 replies
13/23Bluetooth: hci_sync: Convert MGMT_OP_GET_CLOCK_INFOinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+58 -700 replies
14/23Bluetooth: hci_sync: Convert MGMT_OP_SET_LEinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+48 -440 replies
15/23Bluetooth: hci_sync: Convert MGMT_OP_READ_LOCAL_OOB_DATAinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c +1 more+58 -260 replies
16/23Bluetooth: hci_sync: Convert MGMT_OP_READ_LOCAL_OOB_EXT_DATAnet/bluetooth/mgmt.c+20 -170 replies
17/23Bluetooth: hci_sync: Convert MGMT_OP_SET_LOCAL_NAMEinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c net/bluetooth/mgmt.c+34 -340 replies
18/23Bluetooth: hci_sync: Convert MGMT_OP_SET_PHY_CONFIGURATIONnet/bluetooth/mgmt.c+66 -500 replies
19/23Bluetooth: hci_sync: Convert MGMT_OP_SET_ADVERTISINGnet/bluetooth/mgmt.c+48 -550 replies
20/23Bluetooth: hci_sync: Convert adv_expirenet/bluetooth/mgmt.c+19 -140 replies
21/23Bluetooth: hci_sync: Convert MGMT_OP_SSPinclude/net/bluetooth/hci_core.h include/net/bluetooth/hci_sync.h net/bluetooth/hci_event.c +2 more+80 -830 replies
22/23Bluetooth: hci_sync: Rework init stagesinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_core.c net/bluetooth/hci_sync.c+1854 -14030 replies
23/23Bluetooth: hci_sync: Rework hci_suspend_notifierinclude/net/bluetooth/hci_core.h include/net/bluetooth/hci_sync.h net/bluetooth/hci_conn.c +7 more+650 -6380 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v8 yet.

Read the v8 thread

Cover letter [PATCH v8 00/23] Bluetooth: HCI command synchronization

From: Luiz Augusto von Dentz <[email protected]>

This is the initial work to move away from the current design of batch up commands with hci_req_run to be executed asynchronously to instead run them synchronously which enables handling errors properly.

It specially targets enabling the so called LL Privacy feature and simplifying Suspend/Resume code paths since those are the most complicated ones involving multiple state machines (Connection, Advertising, Scanning and Adv Monitor) which requires a bunch commands to be send making the code very complicated to follow.

As a result of these changes the LL Privacy is enabled for the peripheral role, previously only central role had support for it, so it is possible to have advertising sets when LL Privacy is enabled.

Suspend/Resume have been reworked so it no longer needs a state machine to track its progress, the whole process of suspending is handled by hci_suspend_sync and hci_resume_sync for resuming, we also took the time to document the source code to make clear what is their expected behavior.

In order to properly test these changes a number of new tests are being introduced see:

https://patchwork.kernel.org/project/bluetooth/list/?series=565857

v6: Fix CI findings, fix using ERR_PTR/PTR_ERR to pass parameters as user_data and change the use of hci_dev *dev to hci_dev *hdev.
v7: More fixes for CI findings.
v8: Even more fixes for CI findings.

Brian Gix (13):
Bluetooth: hci_sync: Convert MGMT_OP_SET_FAST_CONNECTABLE
Bluetooth: hci_sync: Enable synch'd set_bredr
Bluetooth: hci_sync: Convert MGMT_OP_GET_CONN_INFO
Bluetooth: hci_sync: Convert MGMT_OP_SET_SECURE_CONN
Bluetooth: hci_sync: Convert MGMT_OP_GET_CLOCK_INFO
Bluetooth: hci_sync: Convert MGMT_OP_SET_LE
Bluetooth: hci_sync: Convert MGMT_OP_READ_LOCAL_OOB_DATA
Bluetooth: hci_sync: Convert MGMT_OP_READ_LOCAL_OOB_EXT_DATA
Bluetooth: hci_sync: Convert MGMT_OP_SET_LOCAL_NAME
Bluetooth: hci_sync: Convert MGMT_OP_SET_PHY_CONFIGURATION
Bluetooth: hci_sync: Convert MGMT_OP_SET_ADVERTISING
Bluetooth: hci_sync: Convert adv_expire
Bluetooth: hci_sync: Convert MGMT_OP_SSP

Luiz Augusto von Dentz (9):
Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 1
Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2
Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3
Bluetooth: hci_sync: Enable advertising when LL privacy is enabled
Bluetooth: hci_sync: Rework background scan
Bluetooth: hci_sync: Convert MGMT_SET_POWERED
Bluetooth: hci_sync: Convert MGMT_OP_START_DISCOVERY
Bluetooth: hci_sync: Rework init stages
Bluetooth: hci_sync: Rework hci_suspend_notifier

Marcel Holtmann (1):
Bluetooth: Add helper for serialized HCI command execution

 include/net/bluetooth/bluetooth.h |    2 +
 include/net/bluetooth/hci_core.h  |   21 +-
 include/net/bluetooth/hci_sync.h  |   98 +
 net/bluetooth/Makefile            |    2 +-
 net/bluetooth/hci_conn.c          |   20 +-
 net/bluetooth/hci_core.c          | 1333 +-------
 net/bluetooth/hci_event.c         |  153 +-
 net/bluetooth/hci_request.c       |  338 +-
 net/bluetooth/hci_request.h       |   10 +
 net/bluetooth/hci_sync.c          | 4788 +++++++++++++++++++++++++++++
 net/bluetooth/mgmt.c              | 2050 ++++++------
 net/bluetooth/mgmt_util.c         |   15 +-
 net/bluetooth/mgmt_util.h         |    4 +
 net/bluetooth/msft.c              |  511 +--
 net/bluetooth/msft.h              |   15 +-
 15 files changed, 6370 insertions(+), 2990 deletions(-)
 create mode 100644 include/net/bluetooth/hci_sync.h
 create mode 100644 net/bluetooth/hci_sync.c
Signature · 1 line
2.31.1