Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH bluez] bearer: Cancel disconn_timer upon btd_bearer_disconnected
@ 2026-10-10  7:11 Ye He
  2026-10-10 10:08 ` [bluez] " bluez.test.bot
  2026-10-12 21:50 ` [PATCH bluez] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Ye He @ 2026-10-10  7:11 UTC (permalink / raw)
  To: Linux Bluetooth; +Cc: Ye He

If a fast reconnect occurs after a rapid disconnect,
the 2-seconds bearer->disconn_timer may still fire and
tear down the newly established link.

Fix this by cancelling the disconn_timer inside
btd_bearer_disconnected().

Signed-off-by: Ye He <ye.he@amlogic.com>
---
 src/bearer.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/bearer.c b/src/bearer.c
index 25224dcc7f25d3c5e9adef2644d8f1ae1b5c18ef..5544c2f609d80e2916b98741152f83a134863045 100644
--- a/src/bearer.c
+++ b/src/bearer.c
@@ -464,6 +464,12 @@ void btd_bearer_disconnected(struct btd_bearer *bearer, uint8_t reason)
 	if (!bearer || !bearer->path)
 		return;
 
+	/* cancel disconnect timer if ACL link has already dropped */
+	if (bearer->disconn_timer) {
+		timeout_remove(bearer->disconn_timer);
+		bearer->disconn_timer = 0;
+	}
+
 	if (!btd_device_is_connected(bearer->device))
 		device_disconnect_watches_callback(bearer->device);
 

---
base-commit: 7428ca2df9356363079db0f48412c20cbdb9471f
change-id: 20261010-bearer-disconn-timer-035b48257ae6

Best regards,
-- 
Ye He <ye.he@amlogic.com>


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

end of thread, other threads:[~2026-10-12 21:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-10  7:11 [PATCH bluez] bearer: Cancel disconn_timer upon btd_bearer_disconnected Ye He
2026-10-10 10:08 ` [bluez] " bluez.test.bot
2026-10-12 21:50 ` [PATCH bluez] " 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