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

* RE: [bluez,v2] adapter: Fix RemoveDevice timeout when device already disconnected
  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.test.bot
  2025-07-15 14:50 ` [PATCH bluez v2] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-07-15 10:58 UTC (permalink / raw)
  To: linux-bluetooth, ye.he

[-- Attachment #1: Type: text/plain, Size: 1261 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/project/bluetooth/list/?series=982440

---Test result---

Test Summary:
CheckPatch                    PENDING   0.30 seconds
GitLint                       PENDING   0.34 seconds
BuildEll                      PASS      20.52 seconds
BluezMake                     PASS      2625.96 seconds
MakeCheck                     PASS      20.61 seconds
MakeDistcheck                 PASS      186.19 seconds
CheckValgrind                 PASS      238.98 seconds
CheckSmatch                   PASS      309.33 seconds
bluezmakeextell               PASS      128.85 seconds
IncrementalBuild              PENDING   0.34 seconds
ScanBuild                     PASS      930.39 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH bluez v2] adapter: Fix RemoveDevice timeout when device already disconnected
  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 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-07-15 14:50 UTC (permalink / raw)
  To: Ye He; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 15 Jul 2025 17:28:20 +0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [bluez,v2] adapter: Fix RemoveDevice timeout when device already disconnected
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=8c9977b02169

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] 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