diff mbox series

[BlueZ,v1,1/3] sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle

Message ID 20241106154917.64459-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 469a75ae182a483ecbf71284205dde2508826f84
Headers show
Series [BlueZ,v1,1/3] sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild warning ScanBuild: profiles/audio/a2dp.c:371:8: warning: Use of memory after it is freed if (!cb->resume_cb) ^~~~~~~~~~~~~ 1 warning generated.

Commit Message

Luiz Augusto von Dentz Nov. 6, 2024, 3:49 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If the stream transition to AVDTP_STATE_IDLE it means the stream has
been disconnected, not the session, therefore
btd_service_disconnecting_complete shall not be called otherwise it may
trigger the policy plugin to disconnect AVRCP in cases like codec
reconfiguration.

Fixes: https://github.com/bluez/bluez/issues/1003
---
 profiles/audio/sink.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

bluez.test.bot@gmail.com Nov. 6, 2024, 6:45 p.m. UTC | #1
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=907010

---Test result---

Test Summary:
CheckPatch                    PASS      1.38 seconds
GitLint                       FAIL      1.21 seconds
BuildEll                      PASS      25.68 seconds
BluezMake                     PASS      1790.46 seconds
MakeCheck                     PASS      13.28 seconds
MakeDistcheck                 PASS      186.93 seconds
CheckValgrind                 PASS      258.13 seconds
CheckSmatch                   PASS      368.44 seconds
bluezmakeextell               PASS      123.71 seconds
IncrementalBuild              PASS      4795.54 seconds
ScanBuild                     WARNING   1057.78 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v1,2/3] source: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
1: T1 Title exceeds max length (82>80): "[BlueZ,v1,2/3] source: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle"
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
profiles/audio/a2dp.c:371:8: warning: Use of memory after it is freed
                if (!cb->resume_cb)
                     ^~~~~~~~~~~~~
1 warning generated.



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Nov. 6, 2024, 8:10 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed,  6 Nov 2024 10:49:15 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> If the stream transition to AVDTP_STATE_IDLE it means the stream has
> been disconnected, not the session, therefore
> btd_service_disconnecting_complete shall not be called otherwise it may
> trigger the policy plugin to disconnect AVRCP in cases like codec
> reconfiguration.
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1,1/3] sink: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=469a75ae182a
  - [BlueZ,v1,2/3] source: Fix transitioning to BTD_SERVICE_STATE_DISCONNECTED on idle
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2aade568ce77
  - [BlueZ,v1,3/3] a2dp: Don't wait to reconfigure
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=aa118e965b02

You are awesome, thank you!
diff mbox series

Patch

diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index 77f195436032..7e02bcca1a01 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
@@ -110,6 +110,7 @@  static void avdtp_state_callback(struct btd_device *dev,
 	switch (new_state) {
 	case AVDTP_SESSION_STATE_DISCONNECTED:
 		sink_set_state(sink, SINK_STATE_DISCONNECTED);
+		btd_service_disconnecting_complete(sink->service, 0);
 		break;
 	case AVDTP_SESSION_STATE_CONNECTING:
 		sink_set_state(sink, SINK_STATE_CONNECTING);
@@ -135,8 +136,6 @@  static void stream_state_changed(struct avdtp_stream *stream,
 
 	switch (new_state) {
 	case AVDTP_STATE_IDLE:
-		btd_service_disconnecting_complete(sink->service, 0);
-
 		if (sink->connect_id > 0) {
 			a2dp_cancel(sink->connect_id);
 			sink->connect_id = 0;