Bluetooth: hci_event: Disconnect device when BIG sync is lost
Subsystems (2)
PATCH v2 1/1 Bluetooth: hci_event: Disconnect device when BIG sync is lost
When a BIG sync is lost, the device should be set to "disconnected". This ensures symmetry with the ISO path setup, where the device is marked as "connected" once the path is established. Without this change, the device state remains inconsistent and may lead to a memory leak.
---
Changes in v2:
- Add BIS_LINK handling to device disconnect
- Link to v1: https://lore.kernel.org/r/[email protected]
--- net/bluetooth/hci_event.c | 5 +++++ net/bluetooth/mgmt.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-)
net/bluetooth/hci_event.c +5 -0
@@ -6998,6 +6998,7 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data, {struct hci_evt_le_big_sync_lost *ev = data;struct hci_conn *bis, *conn; +bool mgmt_conn;bt_dev_dbg (hdev,"big handle 0x%2.2x" , ev->handle);
@@ -7016,6 +7017,10 @@ static void hci_le_big_sync_lost_evt(struct hci_dev *hdev, void *data,while ((bis =hci_conn_hash_lookup_big_state (hdev, ev->handle,BT_CONNECTED ,HCI_ROLE_SLAVE ))) { + mgmt_conn =test_and_clear_bit (HCI_CONN_MGMT_CONNECTED , &bis->flags); +mgmt_device_disconnected (hdev, &bis->dst, bis->type, bis->dst_type, + ev->reason, mgmt_conn); +clear_bit (HCI_CONN_BIG_SYNC , &bis->flags);hci_disconn_cfm (bis, ev->reason);hci_conn_del (bis);
net/bluetooth/mgmt.c +3 -1
@@ -9705,7 +9705,9 @@ void mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr,if (!mgmt_connected)return ; -if (link_type !=ACL_LINK && link_type !=LE_LINK ) +if (link_type !=ACL_LINK && + link_type !=LE_LINK && + link_type !=BIS_LINK )return ;bacpy (&ev.addr.bdaddr, bdaddr);
---
base-commit: c921e5d14590381e6db7e451488b7b9ddc67a32c
change-id: 20250819-bis_dev_disconnect-31ad2aed27bc
Best regards,
Signature · 1 line
Yang Li <[email protected]>
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=993280
---Test result---
Test Summary:
CheckPatch PENDING 0.38 seconds GitLint PENDING 0.27 seconds SubjectPrefix PASS 0.08 seconds BuildKernel PASS 25.63 seconds CheckAllWarning PASS 28.49 seconds CheckSparse WARNING 30.37 seconds BuildKernel32 PASS 23.93 seconds TestRunnerSetup PASS 473.64 seconds TestRunner_l2cap-tester PASS 24.56 seconds TestRunner_iso-tester PASS 36.43 seconds TestRunner_bnep-tester PASS 5.90 seconds TestRunner_mgmt-tester FAIL 124.52 seconds TestRunner_rfcomm-tester PASS 9.15 seconds TestRunner_sco-tester PASS 14.57 seconds TestRunner_ioctl-tester PASS 9.90 seconds TestRunner_mesh-tester FAIL 11.36 seconds TestRunner_smp-tester PASS 8.56 seconds TestRunner_userchan-tester PASS 6.18 seconds IncrementalBuild PENDING 0.55 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_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 485 (99.0%), Failed: 1, Not Run: 4
Failed Test Cases
LL Privacy - Add Device 2 (2 Devices to AL) Failed 0.180 seconds
##############################
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.196 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
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 9 lines · On Wed, 20 Aug 2025 10:16:17 +0800 you wrote:
From: Yang Li <[email protected]>
When a BIG sync is lost, the device should be set to "disconnected". This ensures symmetry with the ISO path setup, where the device is marked as "connected" once the path is established. Without this change, the device state remains inconsistent and may lead to a memory leak.
[...]
Here is the summary with links:
- [v2] Bluetooth: hci_event: Disconnect device when BIG sync is lost
https://git.kernel.org/bluetooth/bluetooth-next/c/0dbbf48d4b4b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html