* [PATCH v2 2/4] Bluetooth: ISO: Fix getname not returning broadcast fields
2025-07-29 16:24 [PATCH v2 1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established Luiz Augusto von Dentz
@ 2025-07-29 16:24 ` Luiz Augusto von Dentz
2025-07-29 16:24 ` [PATCH v2 3/4] Bluetooth: hci_conn: Fix running bis_cleanup for hci_conn->type PA_LINK Luiz Augusto von Dentz
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2025-07-29 16:24 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
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")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
net/bluetooth/iso.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 7bd3aa0a6db9..eaffd25570e3 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -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,
--
2.50.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 3/4] Bluetooth: hci_conn: Fix running bis_cleanup for hci_conn->type PA_LINK
2025-07-29 16:24 [PATCH v2 1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established Luiz Augusto von Dentz
2025-07-29 16:24 ` [PATCH v2 2/4] Bluetooth: ISO: Fix getname not returning broadcast fields Luiz Augusto von Dentz
@ 2025-07-29 16:24 ` Luiz Augusto von Dentz
2025-07-29 16:24 ` [PATCH v2 4/4] Bluetooth: hci_conn: Fix not cleaning up Broadcaster/Broadcast Source Luiz Augusto von Dentz
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2025-07-29 16:24 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
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>
---
net/bluetooth/hci_conn.c | 12 +++++++++++-
net/bluetooth/hci_event.c | 7 ++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 7d1e79f69cd1..f8b20b609a03 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -830,7 +830,17 @@ static void bis_cleanup(struct hci_conn *conn)
/* Check if ISO connection is a BIS and terminate advertising
* set and BIG if there are no other connections using it.
*/
- bis = hci_conn_hash_lookup_big(hdev, conn->iso_qos.bcast.big);
+ bis = hci_conn_hash_lookup_big_state(hdev,
+ conn->iso_qos.bcast.big,
+ BT_CONNECTED,
+ HCI_ROLE_MASTER);
+ if (bis)
+ return;
+
+ bis = hci_conn_hash_lookup_big_state(hdev,
+ conn->iso_qos.bcast.big,
+ BT_CONNECT,
+ HCI_ROLE_MASTER);
if (bis)
return;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 8aa5039b975a..4f0a6116291e 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6957,9 +6957,14 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
continue;
}
- if (ev->status != 0x42)
+ if (ev->status != 0x42) {
/* Mark PA sync as established */
set_bit(HCI_CONN_PA_SYNC, &bis->flags);
+ /* Reset cleanup callback of PA Sync so it doesn't
+ * terminate the sync when deleting the connection.
+ */
+ conn->cleanup = NULL;
+ }
bis->sync_handle = conn->sync_handle;
bis->iso_qos.bcast.big = ev->handle;
--
2.50.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH v2 4/4] Bluetooth: hci_conn: Fix not cleaning up Broadcaster/Broadcast Source
2025-07-29 16:24 [PATCH v2 1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established Luiz Augusto von Dentz
2025-07-29 16:24 ` [PATCH v2 2/4] Bluetooth: ISO: Fix getname not returning broadcast fields Luiz Augusto von Dentz
2025-07-29 16:24 ` [PATCH v2 3/4] Bluetooth: hci_conn: Fix running bis_cleanup for hci_conn->type PA_LINK Luiz Augusto von Dentz
@ 2025-07-29 16:24 ` Luiz Augusto von Dentz
2025-07-29 17:13 ` [v2,1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established bluez.test.bot
2025-07-29 18:00 ` [PATCH v2 1/4] " patchwork-bot+bluetooth
4 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2025-07-29 16:24 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This fixes Broadcaster/Broadcast Source not sending HCI_OP_LE_TERM_BIG
because HCI_CONN_PER_ADV where not being set.
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>
---
net/bluetooth/hci_conn.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index f8b20b609a03..ab6fe5b0cc0f 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -2259,7 +2259,7 @@ struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
* the start periodic advertising and create BIG commands have
* been queued
*/
- hci_conn_hash_list_state(hdev, bis_mark_per_adv, PA_LINK,
+ hci_conn_hash_list_state(hdev, bis_mark_per_adv, BIS_LINK,
BT_BOUND, &data);
/* Queue start periodic advertising and create BIG */
--
2.50.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* RE: [v2,1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established
2025-07-29 16:24 [PATCH v2 1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established Luiz Augusto von Dentz
` (2 preceding siblings ...)
2025-07-29 16:24 ` [PATCH v2 4/4] Bluetooth: hci_conn: Fix not cleaning up Broadcaster/Broadcast Source Luiz Augusto von Dentz
@ 2025-07-29 17:13 ` bluez.test.bot
2025-07-29 18:00 ` [PATCH v2 1/4] " patchwork-bot+bluetooth
4 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2025-07-29 17:13 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 2229 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=986789
---Test result---
Test Summary:
CheckPatch PENDING 0.32 seconds
GitLint PENDING 0.25 seconds
SubjectPrefix PASS 0.41 seconds
BuildKernel PASS 24.39 seconds
CheckAllWarning PASS 26.80 seconds
CheckSparse WARNING 30.95 seconds
BuildKernel32 PASS 24.47 seconds
TestRunnerSetup PASS 475.50 seconds
TestRunner_l2cap-tester PASS 24.69 seconds
TestRunner_iso-tester PASS 41.70 seconds
TestRunner_bnep-tester PASS 5.89 seconds
TestRunner_mgmt-tester PASS 126.31 seconds
TestRunner_rfcomm-tester PASS 9.30 seconds
TestRunner_sco-tester PASS 16.67 seconds
TestRunner_ioctl-tester PASS 10.04 seconds
TestRunner_mesh-tester FAIL 11.40 seconds
TestRunner_smp-tester PASS 8.59 seconds
TestRunner_userchan-tester PASS 6.19 seconds
IncrementalBuild PENDING 0.92 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0
Failed Test Cases
Mesh - Send cancel - 1 Timed out 2.128 seconds
Mesh - Send cancel - 2 Timed out 1.995 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established
2025-07-29 16:24 [PATCH v2 1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established Luiz Augusto von Dentz
` (3 preceding siblings ...)
2025-07-29 17:13 ` [v2,1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established bluez.test.bot
@ 2025-07-29 18:00 ` patchwork-bot+bluetooth
4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2025-07-29 18:00 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Tue, 29 Jul 2025 12:24:50 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> 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:
- [v2,1/4] Bluetooth: hci_sync: Fix scan state after PA Sync has been established
https://git.kernel.org/bluetooth/bluetooth-next/c/b0d370caf293
- [v2,2/4] Bluetooth: ISO: Fix getname not returning broadcast fields
https://git.kernel.org/bluetooth/bluetooth-next/c/8c76f275057b
- [v2,3/4] Bluetooth: hci_conn: Fix running bis_cleanup for hci_conn->type PA_LINK
https://git.kernel.org/bluetooth/bluetooth-next/c/11ced36e047b
- [v2,4/4] Bluetooth: hci_conn: Fix not cleaning up Broadcaster/Broadcast Source
https://git.kernel.org/bluetooth/bluetooth-next/c/c5080200bb6e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread