Linux bluetooth development
 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] " bluez.test.bot
  0 siblings, 2 replies; 3+ 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] 3+ messages in thread

* Re: [PATCH BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned
  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-09 23:00 ` [BlueZ] " bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: Pauli Virtanen @ 2026-06-09 22:03 UTC (permalink / raw)
  To: Simon Mikuda, linux-bluetooth

ti, 2026-06-09 kello 23:11 +0200, Simon Mikuda kirjoitti:
> 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;

Zero is valid CIS ID?

> +
>  	if (stream->client && !(stream->locked && link->locked))
>  		return -EINVAL;
>  

-- 
Pauli Virtanen

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

* RE: [BlueZ] shared/bap: Don't link ucast streams before CIS IDs are assigned
  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-09 23:00 ` bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-06-09 23:00 UTC (permalink / raw)
  To: linux-bluetooth, simon.mikuda

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

---Test result---

Test Summary:
CheckPatch                    PASS      0.46 seconds
GitLint                       PASS      0.33 seconds
BuildEll                      PASS      20.37 seconds
BluezMake                     PASS      601.20 seconds
MakeCheck                     PASS      12.72 seconds
MakeDistcheck                 PASS      233.39 seconds
CheckValgrind                 PASS      253.37 seconds
CheckSmatch                   WARNING   322.84 seconds
bluezmakeextell               PASS      165.30 seconds
IncrementalBuild              PASS      608.51 seconds
ScanBuild                     PASS      916.87 seconds

Details
##############################
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


https://github.com/bluez/bluez/pull/2208

---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2026-06-09 23:00 UTC | newest]

Thread overview: 3+ 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-09 23:00 ` [BlueZ] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox