Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_conn: Terminate a PA sync while other PA syncs are open
@ 2026-11-22 20:13 Simon Mikuda
  2026-11-22 22:45 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 20:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz

hci_le_big_terminate() keeps a PA sync while another connection with
HCI_CONN_PA_SYNC has the same BIG. The PA syncs a scan makes to read each
BASE all have the same unset BIG, so one closed while another is open is
never terminated:

    < LE Periodic Advertising Create Sync  50:1E:2D:9E:E7:92
    > LE Periodic Advertising Sync Established  Sync handle: 40
    < LE Periodic Advertising Create Sync  5C:B4:7E:26:20:81
    > LE Periodic Advertising Sync Established  Sync handle: 41
      (both sync sockets closed)
    < LE Periodic Advertising Terminate Sync  Sync handle: 0x0029

A later join to the first broadcaster then fails and the BIG sync never
starts:

    < LE Periodic Advertising Create Sync  50:1E:2D:9E:E7:92
    > Command Status  ACL Connection Already Exists (0x0b)

    bluetoothd: iso_do_big_sync() bt_io_bcast_accept: bind: File
    descriptor in bad state (77)

Count only the connections of the same BIG that have the same sync handle.

Fixes: fcb89f120376 ("Bluetooth: ISO: Fix bcast listener cleanup")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/hci_conn.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 2fb37e078d73..0cbb96d3f961 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -857,6 +857,18 @@ static void find_bis(struct hci_conn *conn, void *data)
 	d->count++;
 }
 
+static void find_pa_sync(struct hci_conn *conn, void *data)
+{
+	struct iso_list_data *d = data;
+
+	/* Ignore if BIG or PA sync doesn't match */
+	if (d->big != conn->iso_qos.bcast.big ||
+	    d->sync_handle != conn->sync_handle)
+		return;
+
+	d->count++;
+}
+
 static int hci_le_big_terminate(struct hci_dev *hdev, struct hci_conn *conn)
 {
 	struct iso_list_data *d;
@@ -874,7 +886,7 @@ static int hci_le_big_terminate(struct hci_dev *hdev, struct hci_conn *conn)
 
 	if (conn->type == PA_LINK &&
 	    test_and_clear_bit(HCI_CONN_PA_SYNC, conn->flags)) {
-		hci_conn_hash_list_flag(hdev, find_bis, PA_LINK,
+		hci_conn_hash_list_flag(hdev, find_pa_sync, PA_LINK,
 					HCI_CONN_PA_SYNC, d);
 
 		if (!d->count)

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: Bluetooth: hci_conn: Terminate a PA sync while other PA syncs are open
  2026-11-22 20:13 [PATCH] Bluetooth: hci_conn: Terminate a PA sync while other PA syncs are open Simon Mikuda
@ 2026-11-22 22:45 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-22 22:45 UTC (permalink / raw)
  To: linux-bluetooth, simon.mikuda

[-- Attachment #1: Type: text/plain, Size: 1606 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/series/1218950/

---Test result---

Test Summary:
CheckPatch                    PASS      0.55 seconds
VerifyFixes                   PASS      0.10 seconds
VerifySignedoff               PASS      0.10 seconds
GitLint                       PASS      0.26 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      19.10 seconds
CheckAllWarning               PASS      22.23 seconds
CheckSparse                   PASS      24.58 seconds
BuildKernel32                 PASS      20.58 seconds
CheckKernelLLVM               PASS      20.44 seconds
TestRunnerSetup               PASS      446.09 seconds
TestRunner_l2cap-tester       PASS      14.75 seconds
TestRunner_iso-tester         PASS      10.88 seconds
TestRunner_bnep-tester        PASS      2.85 seconds
TestRunner_mgmt-tester        PASS      83.24 seconds
TestRunner_rfcomm-tester      PASS      4.04 seconds
TestRunner_sco-tester         PASS      4.96 seconds
TestRunner_ioctl-tester       PASS      4.15 seconds
TestRunner_mesh-tester        PASS      4.08 seconds
TestRunner_smp-tester         PASS      4.00 seconds
TestRunner_userchan-tester    PASS      2.88 seconds
TestRunner_6lowpan-tester     PASS      4.08 seconds
IncrementalBuild              PASS      20.95 seconds



https://github.com/bluez/bluetooth-next/pull/1195

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-22 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 20:13 [PATCH] Bluetooth: hci_conn: Terminate a PA sync while other PA syncs are open Simon Mikuda
2026-11-22 22:45 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox