public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH bluez v2] adapter: Fix RemoveDevice timeout when device already disconnected
@ 2025-07-15  9:28 Ye He via B4 Relay
  2025-07-15 10:58 ` [bluez,v2] " bluez.test.bot
  2025-07-15 14:50 ` [PATCH bluez v2] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Ye He via B4 Relay @ 2025-07-15  9:28 UTC (permalink / raw)
  To: Linux Bluetooth; +Cc: Ye He

From: Ye He <ye.he@amlogic.com>

When attempting to use RemoveDevice to delete a BIS source device that
was synchronized by the BIS sink scan delegator, the kernel marks the
device as disconnected due to PA(period adv) sync termination. However, BlueZ is not
notified of this disconnection and still proceeds to send MGMT Disconnect
command. The kernel responds with MGMT_STATUS_DISCONNECTED, which BlueZ
does not currently handle as a successful case. As a result, the RemoveDevice
call never completes and no D-Bus reply is returned.

Fixes: https://github.com/bluez/bluez/issues/1421

Signed-off-by: Ye He <ye.he@amlogic.com>
---
This patch fix org.bluez.Adapter1.RemoveDevice method call timeout
when device already disconnected.
---
Changes in v2:
- EDITME: modify the title of commit message.
- Link to v1: https://patch.msgid.link/20250712-adapter-rm-device-v1-1-808603331f92@amlogic.com
---
 src/adapter.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/adapter.c b/src/adapter.c
index 79802300bedf4b25cb7c6bc3ea659c122a01efcb..5d68fa4c7dea251af4ff3b05a1ad66204c847c37 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -8619,7 +8619,8 @@ static void disconnect_complete(uint8_t status, uint16_t length,
 	const struct mgmt_rp_disconnect *rp = param;
 	struct btd_adapter *adapter = user_data;
 
-	if (status == MGMT_STATUS_NOT_CONNECTED) {
+	if (status == MGMT_STATUS_NOT_CONNECTED ||
+		status == MGMT_STATUS_DISCONNECTED) {
 		btd_warn(adapter->dev_id,
 				"Disconnecting failed: already disconnected");
 	} else if (status != MGMT_STATUS_SUCCESS) {

---
base-commit: 806dd732fcda584fa6c44322a74373d2b739c781
change-id: 20250712-adapter-rm-device-12aae5651251

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



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

end of thread, other threads:[~2025-07-15 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15  9:28 [PATCH bluez v2] adapter: Fix RemoveDevice timeout when device already disconnected Ye He via B4 Relay
2025-07-15 10:58 ` [bluez,v2] " bluez.test.bot
2025-07-15 14:50 ` [PATCH bluez v2] " 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