[PATCH v3 6/6] Bluetooth: hci_event: Notify the driver only of SCO links that came up

From: Hitalo Souza

Date: Thu Oct 08 2026 - 18:27:34 EST


hci_sync_conn_complete_evt() notifies the driver of the air mode of a
synchronous connection whether or not its link came up, while
hci_conn_complete_evt() only does it for a link that did. A connection
whose link failed, or that refused the handle as it is being aborted,
is deleted right after, which notifies HCI_NOTIFY_DISABLE_SCO. btusb
picks the alternate setting of its isochronous interface from the latest
of these notifications whenever the number of SCO connections changes,
and HCI_NOTIFY_DISABLE_SCO selects no air mode: with another SCO
connection still up, the interface ends up at alternate setting 0, which
stops the audio of the connection that is up.

Only notify the driver when the link came up.

Fixes: 1f8330ea1692 ("Bluetooth: add support to notify using SCO air mode")
Assisted-by: LLM
Signed-off-by: Hitalo Souza <enghitalo@xxxxxxxxx>
---
net/bluetooth/hci_event.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 14270711c..28fefddf9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5307,10 +5307,11 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev, void *data,
}

bt_dev_dbg(hdev, "SCO connected with air mode: %02x", ev->air_mode);
- /* Notify only in case of SCO over HCI transport data path which
- * is zero and non-zero value shall be non-HCI transport data path
+ /* Notify only of a link that came up, and only in case of SCO over
+ * HCI transport data path which is zero and non-zero value shall be
+ * non-HCI transport data path
*/
- if (conn->codec.data_path == 0 && hdev->notify) {
+ if (!status && conn->codec.data_path == 0 && hdev->notify) {
switch (ev->air_mode) {
case 0x02:
hdev->notify(hdev, HCI_NOTIFY_ENABLE_SCO_CVSD);
--
2.55.0