public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ bluez v4] shared/bap: Add stream state check in stream_disable
@ 2025-07-07  6:00 Yang Li via B4 Relay
  2025-07-07  7:13 ` [BlueZ,bluez,v4] " bluez.test.bot
  2025-07-07 14:50 ` [PATCH BlueZ bluez v4] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Li via B4 Relay @ 2025-07-07  6:00 UTC (permalink / raw)
  To: Linux Bluetooth; +Cc: Yang Li

From: Yang Li <yang.li@amlogic.com>

Add BT_BAP_STREAM_STATE_CONFIG state check so that stream_disable() is
a no-op when the stream is in CONFIG state. This prevents unexpected state
transitions or redundant operations during cleanup.

Error trace:
bluetoothd[2313]: src/shared/bap.c:stream_io_disconnected() stream 0x1f9fc20 io disconnected
bluetoothd[2313]: src/shared/bap.c:bap_ucast_set_state() stream 0x1f9fc20 dir 0x01: releasing -> config
bluetoothd[2313]: src/shared/bap.c:stream_notify() stream 0x1f9fc20 state 1
bluetoothd[2313]: profiles/audio/transport.c:bap_state_changed() stream 0x1f9fc20: releasing(6) -> config(1)
...
bluetoothd[2313]: src/shared/bap.c:stream_disable() stream 0x1f9fc20
bluetoothd[2313]: src/shared/bap.c:bap_ucast_set_state() stream 0x1f9fc20 dir 0x01: config -> qos

Signed-off-by: Yang Li <yang.li@amlogic.com>
---
Changes in v4:
- Optimizing the code and update the commit message
- Link to v3: https://patch.msgid.link/20250702-bap_for_big_sync_lost-v3-1-d314b60abf7a@amlogic.com

Changes in v3:
- Optimizing the code
- Link to v2: https://patch.msgid.link/20250630-bap_for_big_sync_lost-v2-0-1491b608cda5@amlogic.com

bap for big sync lost

To: Linux Bluetooth <linux-bluetooth@vger.kernel.org>
Signed-off-by: Yang Li <yang.li@amlogic.com>

Changes in v2:
- Add state check in stream_disable.
- Add type check in stream_io_disconnected.
- Link to v1: https://patch.msgid.link/20250624-bap_for_big_sync_lost-v1-1-0df90a0f55d0@amlogic.com
---
 src/shared/bap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 40e1c974b..2d4f003c7 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -2124,6 +2124,7 @@ static unsigned int bap_ucast_start(struct bt_bap_stream *stream,
 static uint8_t stream_disable(struct bt_bap_stream *stream, struct iovec *rsp)
 {
 	if (!stream || stream->ep->state == BT_BAP_STREAM_STATE_QOS ||
+			stream->ep->state == BT_BAP_STREAM_STATE_CONFIG ||
 			stream->ep->state == BT_BAP_STREAM_STATE_IDLE)
 		return 0;
 

---
base-commit: 55a6763cde8a2309fd23a96479ee4cf2fc23a442
change-id: 20250624-bap_for_big_sync_lost-63476c679dbb

Best regards,
-- 
Yang Li <yang.li@amlogic.com>



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

end of thread, other threads:[~2025-07-07 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07  6:00 [PATCH BlueZ bluez v4] shared/bap: Add stream state check in stream_disable Yang Li via B4 Relay
2025-07-07  7:13 ` [BlueZ,bluez,v4] " bluez.test.bot
2025-07-07 14:50 ` [PATCH BlueZ bluez v4] " 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