public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1] bap: Don't attempt to release if old state was releasing
Date: Fri,  8 Dec 2023 17:12:13 -0500	[thread overview]
Message-ID: <20231208221219.54529-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If the old state was releasing there is no reason to call
bt_bap_stream_release yet again when IO could not be created as that
will likely create a loop situation when the remote stack caches the
codec configuration.
---
 profiles/audio/bap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index c279b5b0e133..c530799915f3 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1918,7 +1918,9 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state,
 			bap_create_io(data, ep, stream, true);
 			if (!ep->io) {
 				error("Unable to create io");
-				bt_bap_stream_release(stream, NULL, NULL);
+				if (old_state != BT_BAP_STREAM_STATE_RELEASING)
+					bt_bap_stream_release(stream, NULL,
+								NULL);
 				return;
 			}
 
-- 
2.43.0


             reply	other threads:[~2023-12-08 22:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 22:12 Luiz Augusto von Dentz [this message]
2023-12-08 22:12 ` [PATCH BlueZ v2 1/6] bap: Allow setup of multiple stream per endpoint Luiz Augusto von Dentz
2023-12-08 22:36   ` [BlueZ,v2,1/6] " bluez.test.bot
2023-12-11 22:28   ` bluez.test.bot
2023-12-08 22:12 ` [PATCH BlueZ v2 2/6] shared/bap: Make bt_bap_select match the channel map Luiz Augusto von Dentz
2023-12-08 22:12 ` [PATCH BlueZ v2 3/6] org.bluez.MediaEndpoint: Add ChannelAllocation to SelectProperties Luiz Augusto von Dentz
2023-12-08 22:12 ` [PATCH BlueZ v2 4/6] shared/bap: Make bt_bap_select select a location Luiz Augusto von Dentz
2023-12-08 22:12 ` [PATCH BlueZ v2 5/6] shared/bap: Fix stream IO linking Luiz Augusto von Dentz
2023-12-08 22:12 ` [PATCH BlueZ v2 6/6] client/player: Use ChannelAllocation given on SelectProperties Luiz Augusto von Dentz
2023-12-09  0:20 ` [BlueZ,v1] bap: Don't attempt to release if old state was releasing bluez.test.bot
2023-12-11 21:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
2023-12-15 20:50 ` patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231208221219.54529-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox