Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: a7bcffc673de ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

+17 -2
+11 -1
net/bluetooth/hci_conn.c
··· 830 830 /* Check if ISO connection is a BIS and terminate advertising 831 831 * set and BIG if there are no other connections using it. 832 832 */ 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); 834 844 if (bis) 835 845 return; 836 846
+6 -1
net/bluetooth/hci_event.c
··· 6957 6957 continue; 6958 6958 } 6959 6959 6960 - if (ev->status != 0x42) 6960 + if (ev->status != 0x42) { 6961 6961 /* Mark PA sync as established */ 6962 6962 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 + } 6963 6968 6964 6969 bis->sync_handle = conn->sync_handle; 6965 6970 bis->iso_qos.bcast.big = ev->handle;