Skip to contentSkip to conversation

Bluetooth: hci_sync: Fix scan state after PA Sync has been established

PATCH Applied Luiz Augusto von Dentz 2 participants 4 messages Jul 24, 2025

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: hci_sync: Fix scan state after PA Sync has been established

From: Luiz Augusto von Dentz <[email protected]>

Passive scanning is used to program the address of the peer to be synchronized, so once HCI_EV_LE_PA_SYNC_ESTABLISHED is received it needs to be updated after clearing HCI_PA_SYNC then call hci_update_passive_scan_sync to return it to its original state.

Fixes 6d0417e4e1cf ("Bluetooth: hci_conn: Fix not setting conn_timeout for Broadcast Receiver")
---
 net/bluetooth/hci_sync.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/bluetooth/hci_sync.c +5 -2
index 2b4f21fbf9c1..ae165e693533 100644
@@ -6985,8 +6985,6 @@ static void create_pa_complete(struct hci_dev *hdev, void *data, int err)
 
 	hci_dev_lock(hdev);
 
-	hci_dev_clear_flag(hdev, HCI_PA_SYNC);
-
 	if (!hci_conn_valid(hdev, conn))
 		clear_bit(HCI_CONN_CREATE_PA_SYNC, &conn->flags);
 
@@ -7080,6 +7078,11 @@ static int hci_le_pa_create_sync(struct hci_dev *hdev, void *data)
 		__hci_cmd_sync_status(hdev, HCI_OP_LE_PA_CREATE_SYNC_CANCEL,
 				      0, NULL, HCI_CMD_TIMEOUT);
 
+	hci_dev_clear_flag(hdev, HCI_PA_SYNC);
+
+	/* Update passive scan since HCI_PA_SYNC flag has been cleared */
+	hci_update_passive_scan_sync(hdev);
+
 	return err;
 }
 
Signature · 1 line
2.50.1
author maintainer
#1 lore raw

PATCH 1/1 Bluetooth: ISO: Fix getname not returning broadcast fields

From: Luiz Augusto von Dentz <[email protected]>

getname shall return iso_bc fields for both BIS_LINK and PA_LINK since the likes of bluetoothd do use the getpeername to retrieve the SID both when enumerating the broadcasters and when synchronizing.

Fixes a7bcffc673de ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections")
---
 net/bluetooth/iso.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/iso.c +1 -1
index 7bd3aa0a6db9..eaffd25570e3 100644
@@ -1347,7 +1347,7 @@ static int iso_sock_getname(struct socket *sock, struct sockaddr *addr,
 		bacpy(&sa->iso_bdaddr, &iso_pi(sk)->dst);
 		sa->iso_bdaddr_type = iso_pi(sk)->dst_type;
 
-		if (hcon && hcon->type == BIS_LINK) {
+		if (hcon && (hcon->type == BIS_LINK || hcon->type == PA_LINK)) {
 			sa->iso_bc->bc_sid = iso_pi(sk)->bc_sid;
 			sa->iso_bc->bc_num_bis = iso_pi(sk)->bc_num_bis;
 			memcpy(sa->iso_bc->bc_bis, iso_pi(sk)->bc_bis,
Signature · 1 line
2.50.1
#2 lore raw

Re: [PATCH v1] Bluetooth: ISO: Fix getname not returning broadcast fields

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 10 lines · On Thu, 24 Jul 2025 16:52:59 -0400 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

getname shall return iso_bc fields for both BIS_LINK and PA_LINK since the likes of bluetoothd do use the getpeername to retrieve the SID both when enumerating the broadcasters and when synchronizing.

Fixes a7bcffc673de ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections")

[...]

Here is the summary with links:
- [v1] Bluetooth: ISO: Fix getname not returning broadcast fields

    https://git.kernel.org/bluetooth/bluetooth-next/c/05f7f9433718

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · On Thu, 24 Jul 2025 16:52:58 -0400 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

Passive scanning is used to program the address of the peer to be synchronized, so once HCI_EV_LE_PA_SYNC_ESTABLISHED is received it needs to be updated after clearing HCI_PA_SYNC then call hci_update_passive_scan_sync to return it to its original state.

[...]

Here is the summary with links:
- [v1] Bluetooth: hci_sync: Fix scan state after PA Sync has been established

    https://git.kernel.org/bluetooth/bluetooth-next/c/1f3837de85e7

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html