* [PATCH v2] Bluetooth: hci_event: Disconnect device when BIG sync is lost
@ 2025-08-20 2:16 Yang Li via B4 Relay
2025-08-22 14:40 ` patchwork-bot+bluetooth
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li via B4 Relay @ 2025-08-20 2:16 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
Cc: Luiz Augusto von Dentz, linux-bluetooth, linux-kernel, Yang Li
From: Yang Li <yang.li@amlogic.com>
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.
Fixes: b2a5f2e1c127 ("Bluetooth: hci_event: Add support for handling LE BIG Sync Lost event")
Signed-off-by: Yang Li <yang.li@amlogic.com>
---
Changes in v2:
- Add BIS_LINK handling to device disconnect
- Link to v1: https://lore.kernel.org/r/20250819-bis_dev_disconnect-v1-1-a87c540efc46@amlogic.com
---
net/bluetooth/hci_event.c | 5 +++++
net/bluetooth/mgmt.c | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 1686680a38c8..59aae893e0ed 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -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);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 3166f5fb876b..90e37ff2c85d 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -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,
--
Yang Li <yang.li@amlogic.com>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] Bluetooth: hci_event: Disconnect device when BIG sync is lost
2025-08-20 2:16 [PATCH v2] Bluetooth: hci_event: Disconnect device when BIG sync is lost Yang Li via B4 Relay
@ 2025-08-22 14:40 ` patchwork-bot+bluetooth
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2025-08-22 14:40 UTC (permalink / raw)
To: Yang Li
Cc: marcel, johan.hedberg, luiz.dentz, luiz.von.dentz,
linux-bluetooth, linux-kernel
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Wed, 20 Aug 2025 10:16:17 +0800 you wrote:
> From: Yang Li <yang.li@amlogic.com>
>
> 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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-22 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-20 2:16 [PATCH v2] Bluetooth: hci_event: Disconnect device when BIG sync is lost Yang Li via B4 Relay
2025-08-22 14:40 ` patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®