From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> 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 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 -- 2.31.1