Skip to content

Commit d36349e

Browse files
committed
Bluetooth: hci_conn: Fix running bis_cleanup for hci_conn->type PA_LINK
Connections with type of PA_LINK shall be considered temporary just to track the lifetime of PA Sync setup, once the BIG Sync is established and connection are created with BIS_LINK the existing PA_LINK connection shall not longer use bis_cleanup otherwise it terminates the PA Sync when that shall be left to BIS_LINK connection to do it. Fixes: a7bcffc ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent aee29c1 commit d36349e

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

net/bluetooth/hci_conn.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,17 @@ static void bis_cleanup(struct hci_conn *conn)
830830
/* Check if ISO connection is a BIS and terminate advertising
831831
* set and BIG if there are no other connections using it.
832832
*/
833-
bis = hci_conn_hash_lookup_big(hdev, conn->iso_qos.bcast.big);
833+
bis = hci_conn_hash_lookup_big_state(hdev,
834+
conn->iso_qos.bcast.big,
835+
BT_CONNECTED,
836+
HCI_ROLE_MASTER);
837+
if (bis)
838+
return;
839+
840+
bis = hci_conn_hash_lookup_big_state(hdev,
841+
conn->iso_qos.bcast.big,
842+
BT_CONNECT,
843+
HCI_ROLE_MASTER);
834844
if (bis)
835845
return;
836846

net/bluetooth/hci_event.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6957,9 +6957,14 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
69576957
continue;
69586958
}
69596959

6960-
if (ev->status != 0x42)
6960+
if (ev->status != 0x42) {
69616961
/* Mark PA sync as established */
69626962
set_bit(HCI_CONN_PA_SYNC, &bis->flags);
6963+
/* Reset cleanup callback of PA Sync so it doesn't
6964+
* terminate the sync when deleting the connection.
6965+
*/
6966+
conn->cleanup = NULL;
6967+
}
69636968

69646969
bis->sync_handle = conn->sync_handle;
69656970
bis->iso_qos.bcast.big = ev->handle;

0 commit comments

Comments
 (0)