linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] shared/bap: Fix attempting to disable stream when it is idle
@ 2022-09-12 21:42 Luiz Augusto von Dentz
  2022-09-12 22:20 ` [BlueZ] " bluez.test.bot
  2022-09-13  1:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2022-09-12 21:42 UTC (permalink / raw)
  To: linux-bluetooth

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

If the stream is already in idle state do not attempt to disable it
again.
---
 src/shared/bap.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index c5f1134d8d8a..7b23a33474bd 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1050,13 +1050,15 @@ static void bap_stream_free(void *data)
 	free(stream);
 }
 
-static void bap_ep_detach(struct bt_bap_endpoint *ep)
+static void bap_stream_detach(struct bt_bap_stream *stream)
 {
-	struct bt_bap_stream *stream = ep->stream;
+	struct bt_bap_endpoint *ep = stream->ep;
 
-	if (!stream)
+	if (!ep)
 		return;
 
+	DBG(stream->bap, "stream %p ep %p", stream, ep);
+
 	queue_remove(stream->bap->streams, stream);
 	bap_stream_clear_cfm(stream);
 
@@ -1281,7 +1283,7 @@ static void bap_stream_state_changed(struct bt_bap_stream *stream)
 	/* Post notification updates */
 	switch (stream->ep->state) {
 	case BT_ASCS_ASE_STATE_IDLE:
-		bap_ep_detach(stream->ep);
+		bap_stream_detach(stream);
 		break;
 	case BT_ASCS_ASE_STATE_QOS:
 		break;
@@ -1838,7 +1840,8 @@ static uint8_t stream_disable(struct bt_bap_stream *stream, struct iovec *rsp)
 {
 	DBG(stream->bap, "stream %p", stream);
 
-	if (!stream || stream->ep->state == BT_BAP_STREAM_STATE_QOS)
+	if (!stream || stream->ep->state == BT_BAP_STREAM_STATE_QOS ||
+			stream->ep->state == BT_BAP_STREAM_STATE_IDLE)
 		return 0;
 
 	ascs_ase_rsp_success(rsp, stream->ep->id);
-- 
2.37.3


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

* RE: [BlueZ] shared/bap: Fix attempting to disable stream when it is idle
  2022-09-12 21:42 [PATCH BlueZ] shared/bap: Fix attempting to disable stream when it is idle Luiz Augusto von Dentz
@ 2022-09-12 22:20 ` bluez.test.bot
  2022-09-13  1:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2022-09-12 22:20 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

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

---Test result---

Test Summary:
CheckPatch                    PASS      1.53 seconds
GitLint                       PASS      0.98 seconds
Prep - Setup ELL              PASS      26.18 seconds
Build - Prep                  PASS      0.89 seconds
Build - Configure             PASS      8.22 seconds
Build - Make                  PASS      728.95 seconds
Make Check                    PASS      11.08 seconds
Make Check w/Valgrind         PASS      286.38 seconds
Make Distcheck                PASS      235.27 seconds
Build w/ext ELL - Configure   PASS      8.27 seconds
Build w/ext ELL - Make        PASS      82.56 seconds
Incremental Build w/ patches  PASS      0.00 seconds
Scan Build                    PASS      504.29 seconds



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] shared/bap: Fix attempting to disable stream when it is idle
  2022-09-12 21:42 [PATCH BlueZ] shared/bap: Fix attempting to disable stream when it is idle Luiz Augusto von Dentz
  2022-09-12 22:20 ` [BlueZ] " bluez.test.bot
@ 2022-09-13  1:00 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2022-09-13  1:00 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +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, 12 Sep 2022 14:42:57 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> If the stream is already in idle state do not attempt to disable it
> again.
> ---
>  src/shared/bap.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)

Here is the summary with links:
  - [BlueZ] shared/bap: Fix attempting to disable stream when it is idle
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=877b88c5f2e9

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:[~2022-09-13  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12 21:42 [PATCH BlueZ] shared/bap: Fix attempting to disable stream when it is idle Luiz Augusto von Dentz
2022-09-12 22:20 ` [BlueZ] " bluez.test.bot
2022-09-13  1:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).