All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned
@ 2026-06-09 21:11 Simon Mikuda
  2026-06-09 22:03 ` Pauli Virtanen
  2026-06-09 23:00 ` [BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned bluez.test.bot
  0 siblings, 2 replies; 12+ messages in thread
From: Simon Mikuda @ 2026-06-09 21:11 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda

bap_ucast_io_link pairs streams whose CIG/CIS IDs match, but the IDs
are unset in Codec Configured state, so a Sink and Source bound for
different CISes get linked. The stray link later propagates a
disconnect to the wrong ASE and breaks Receiver Start Ready.

Skip linking until QoS Configured assigns the IDs.

Fixes PTS test BAP/USR/STR/BV-362-C
---
 src/shared/bap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index deb85b264..98537de60 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2679,6 +2679,12 @@ static int bap_ucast_io_link(struct bt_bap_stream *stream,
 			stream->ep->dir == link->ep->dir)
 		return -EINVAL;
 
+	/* Don't link until QoS Configured assigns the CIS IDs; while unset
+	 * the check above would pair unrelated streams.
+	 */
+	if (!stream->qos.ucast.cis_id || !link->qos.ucast.cis_id)
+		return -EINVAL;
+
 	if (stream->client && !(stream->locked && link->locked))
 		return -EINVAL;
 
-- 
2.43.0


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

end of thread, other threads:[~2026-06-14 13:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 21:11 [PATCH BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned Simon Mikuda
2026-06-09 22:03 ` Pauli Virtanen
2026-06-10  7:46   ` Simon Mikuda
2026-06-10 13:06     ` Luiz Augusto von Dentz
2026-06-14  9:55     ` [PATCH BlueZ v2 1/2] shared/bap: Initialize ucast/bcast IDs as unset Simon Mikuda
2026-06-14  9:55       ` [PATCH BlueZ v2 2/2] shared/bap: Don't link server ucast streams before CIS IDs are assigned Simon Mikuda
2026-06-14 10:24       ` [PATCH BlueZ v2 1/2] shared/bap: Initialize ucast/bcast IDs as unset Pauli Virtanen
2026-06-14 11:05       ` [BlueZ,v2,1/2] " bluez.test.bot
2026-06-14 10:50     ` [PATCH BlueZ v3 1/2] " Simon Mikuda
2026-06-14 10:50       ` [PATCH BlueZ v3 2/2] shared/bap: Don't link server ucast streams before CIS IDs are assigned Simon Mikuda
2026-06-14 13:03       ` [BlueZ,v3,1/2] shared/bap: Initialize ucast/bcast IDs as unset bluez.test.bot
2026-06-09 23:00 ` [BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned bluez.test.bot

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.