[PATCH v3 0/4] Bluetooth: Improve retrying of connection attempts

From: Jonas Dreßler
Date: Mon Jan 08 2024 - 17:46:43 EST


Since commit 4c67bc74f016 ("[Bluetooth] Support concurrent connect
requests"), the kernel supports trying to connect again in case the
bluetooth card is busy and fails to connect.

The logic that should handle this became a bit spotty over time, and also
cards these days appear to fail with more errors than just "Command
Disallowed".

This series refactores the handling of concurrent connection requests
by serializing all "Create Connection" commands for ACL connections
similar to how we do it for LE connections.

---

v1: https://lore.kernel.org/linux-bluetooth/20240102185933.64179-1-verdre@xxxxxxx/
v2: https://lore.kernel.org/linux-bluetooth/20240108183938.468426-1-verdre@xxxxxxx/
v3:
- Move the new sync function to hci_sync.c as requested by review
- Abort connection on failure using hci_abort_conn_sync() instead of
hci_abort_conn()
- Make the last commit message a bit more precise regarding the meaning
of BT_CONNECT2 state

Jonas Dreßler (4):
Bluetooth: Remove superfluous call to hci_conn_check_pending()
Bluetooth: hci_event: Use HCI error defines instead of magic values
Bluetooth: hci_conn: Only do ACL connections sequentially
Bluetooth: Remove pending ACL connection attempts

include/net/bluetooth/hci.h | 3 ++
include/net/bluetooth/hci_core.h | 1 -
include/net/bluetooth/hci_sync.h | 3 ++
net/bluetooth/hci_conn.c | 83 +++-----------------------------
net/bluetooth/hci_event.c | 29 +++--------
net/bluetooth/hci_sync.c | 72 +++++++++++++++++++++++++++
6 files changed, 93 insertions(+), 98 deletions(-)

--
2.43.0