diff mbox series

[BlueZ,v1] avdtp: Fix triggering disconnect_timeout while discovering capabilities

Message ID 20241015194254.543683-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1] avdtp: Fix triggering disconnect_timeout while discovering capabilities | expand

Commit Message

Luiz Augusto von Dentz Oct. 15, 2024, 7:42 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If there are many endpoint registered it may delay the discovering of
the capabilities long enough to trigger diconnect_timeout which may
cause unexpected collisions/disconnections.

Fixes: https://github.com/bluez/bluez/issues/981
---
 profiles/audio/avdtp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

bluez.test.bot@gmail.com Oct. 15, 2024, 9:43 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=899479

---Test result---

Test Summary:
CheckPatch                    PASS      0.44 seconds
GitLint                       FAIL      0.53 seconds
BuildEll                      PASS      27.53 seconds
BluezMake                     PASS      1671.68 seconds
MakeCheck                     PASS      12.96 seconds
MakeDistcheck                 PASS      182.32 seconds
CheckValgrind                 PASS      256.64 seconds
CheckSmatch                   PASS      360.94 seconds
bluezmakeextell               PASS      120.32 seconds
IncrementalBuild              PASS      1424.95 seconds
ScanBuild                     PASS      1010.25 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v1] avdtp: Fix triggering disconnect_timeout while discovering capabilities

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] avdtp: Fix triggering disconnect_timeout while discovering capabilities"


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

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

On Tue, 15 Oct 2024 15:42:54 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> If there are many endpoint registered it may delay the discovering of
> the capabilities long enough to trigger diconnect_timeout which may
> cause unexpected collisions/disconnections.
> 
> Fixes: https://github.com/bluez/bluez/issues/981
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1] avdtp: Fix triggering disconnect_timeout while discovering capabilities
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c1d01a378f23

You are awesome, thank you!
diff mbox series

Patch

diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 289b40827d88..80fbe847e043 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -2037,6 +2037,14 @@  failed:
 static gboolean avdtp_parse_cmd(struct avdtp *session, uint8_t transaction,
 				uint8_t signal_id, void *buf, int size)
 {
+	/* Reset disconnect timer if command is received */
+	if (session->dc_timer) {
+		timeout_remove(session->dc_timer);
+		session->dc_timer = timeout_add_seconds(session->dc_timeout,
+						disconnect_timeout,
+						session, NULL);
+	}
+
 	switch (signal_id) {
 	case AVDTP_DISCOVER:
 		DBG("Received DISCOVER_CMD");