All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2] shared/bap: reset local ep state on stream detach
@ 2025-08-11 18:48 Pauli Virtanen
  2025-08-11 20:09 ` [BlueZ,v2] " bluez.test.bot
  2025-08-12  1:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Pauli Virtanen @ 2025-08-11 18:48 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

When removing streams in bt_bap_detach(), they are detached directly
without going through normal state transitions.  As BAP Unicast Server,
this leaves local endpoints to the state they were in, so they persist
if client connects again.  This is not wanted.

For server streams, clear the local ASE state on detach.  At that point,
the ASE is either already idle or the session is detached.

Don't modify state of remote endpoints (BAP Client streams), as only
remote server should do that.
---

Notes:
    v2:
    - clear endpoint in bap_ucast_detach(), for BAP Server only

 src/shared/bap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index c0f0c4f3c..9b7395223 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1357,6 +1357,12 @@ static void bap_ucast_detach(struct bt_bap_stream *stream)
 	bap_stream_clear_cfm(stream);
 
 	ep->stream = NULL;
+
+	if (!stream->client) {
+		ep->state = BT_ASCS_ASE_STATE_IDLE;
+		ep->old_state = BT_ASCS_ASE_STATE_IDLE;
+	}
+
 	bt_bap_stream_unref(stream);
 }
 
-- 
2.50.1


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

* RE: [BlueZ,v2] shared/bap: reset local ep state on stream detach
  2025-08-11 18:48 [PATCH BlueZ v2] shared/bap: reset local ep state on stream detach Pauli Virtanen
@ 2025-08-11 20:09 ` bluez.test.bot
  2025-08-12  1:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-08-11 20:09 UTC (permalink / raw)
  To: linux-bluetooth, pav

[-- Attachment #1: Type: text/plain, Size: 1864 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=990189

---Test result---

Test Summary:
CheckPatch                    PENDING   0.31 seconds
GitLint                       PENDING   0.33 seconds
BuildEll                      PASS      20.00 seconds
BluezMake                     PASS      2590.39 seconds
MakeCheck                     PASS      20.42 seconds
MakeDistcheck                 PASS      185.79 seconds
CheckValgrind                 PASS      236.93 seconds
CheckSmatch                   WARNING   307.43 seconds
bluezmakeextell               PASS      129.76 seconds
IncrementalBuild              PENDING   0.37 seconds
ScanBuild                     PASS      928.09 seconds

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

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

##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:317:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures
##############################
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] shared/bap: reset local ep state on stream detach
  2025-08-11 18:48 [PATCH BlueZ v2] shared/bap: reset local ep state on stream detach Pauli Virtanen
  2025-08-11 20:09 ` [BlueZ,v2] " bluez.test.bot
@ 2025-08-12  1:20 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-08-12  1:20 UTC (permalink / raw)
  To: Pauli Virtanen; +Cc: linux-bluetooth

Hello:

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

On Mon, 11 Aug 2025 21:48:52 +0300 you wrote:
> When removing streams in bt_bap_detach(), they are detached directly
> without going through normal state transitions.  As BAP Unicast Server,
> this leaves local endpoints to the state they were in, so they persist
> if client connects again.  This is not wanted.
> 
> For server streams, clear the local ASE state on detach.  At that point,
> the ASE is either already idle or the session is detached.
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2] shared/bap: reset local ep state on stream detach
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=8a304f7fd960

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-08-12  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 18:48 [PATCH BlueZ v2] shared/bap: reset local ep state on stream detach Pauli Virtanen
2025-08-11 20:09 ` [BlueZ,v2] " bluez.test.bot
2025-08-12  1:20 ` [PATCH BlueZ v2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.