All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] transport: Preserve Release on late BAP ready
@ 2026-09-18 20:21 dt
  2026-09-18 20:22 ` [PATCH BlueZ 2/3] bap: Recreate stream IO after an early Enable dt
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: dt @ 2026-09-18 20:21 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org

From: Derek Tern <1263187-dt@users.noreply.gitlab.freedesktop.org>

A late stream-ready event can reach bap_resume_complete() after Release
has queued Disable. It then replies to Release with an Acquire payload
and drops the Disable request ID. Client disconnection can subsequently
free the owner while the Disable callback still refers to it.

Only complete pending Acquire/TryAcquire requests from this path. Leave
Release and its request ID for the Disable callback or cancellation.
---
Based on master ebbb4ee31. The new resume test fails all three pause
variants on that base with malformed Release replies and a Disable
cleanup crash. With the series: 7 targeted functional tests and all 697
BAP unit tests pass. The tests check transport lifecycle, not audio data.

 profiles/audio/transport.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index e3f3df50e..02c5c7ac0 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -1952,8 +1952,16 @@ static void bap_resume_complete(struct media_transport *transport)
 	if (!owner)
 		return;
 
-	if (owner->pending)
+	if (owner->pending) {
+		const char *member;
+
+		member = dbus_message_get_member(owner->pending->msg);
+		/* A late ready event must not complete a pending Release. */
+		if (strcmp(member, "Acquire") && strcmp(member, "TryAcquire"))
+			return;
+
 		owner->pending->id = 0;
+	}
 
 	if (transport->fd < 0) {
 		media_transport_remove_owner(transport);


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

end of thread, other threads:[~2026-10-07 18:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-18 20:21 [PATCH BlueZ 1/3] transport: Preserve Release on late BAP ready dt
2026-09-18 20:22 ` [PATCH BlueZ 2/3] bap: Recreate stream IO after an early Enable dt
2026-09-18 20:24 ` [PATCH BlueZ 3/3] test: Cover BAP transport release and reacquire dt
2026-09-18 21:44   ` Luiz Augusto von Dentz
2026-09-19 10:06     ` dt
2026-09-18 23:30 ` [BlueZ,1/3] transport: Preserve Release on late BAP ready bluez.test.bot
2026-10-04  0:02 ` bluez.test.bot
2026-10-07 18:40 ` [PATCH BlueZ 1/3] " 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.