Skip to contentSkip to conversation

gas: Fix reading attributes on every connection

PATCH Applied Luiz Augusto von Dentz 3 participants 3 messages Jun 18, 2024 – Jun 19, 2024 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 gas: Fix reading attributes on every connection

From: Luiz Augusto von Dentz <[email protected]>

Attributes only need to be read once after that they will be persisted by the core so there is no need to keep reading them on every reconnection.

---
 profiles/gap/gas.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
profiles/gap/gas.c +4 -4
index dbe5f003bfba..08aaf19cb332 100644
@@ -342,6 +342,10 @@ static int gap_accept(struct btd_service *service)
 		goto _finish;
 	}
 
+	/* Check if attribute already has been discovered */
+	if (gas->attr)
+		goto _finish;
+
 	gas->db = gatt_db_ref(db);
 	gas->client = bt_gatt_client_clone(client);
 
@@ -364,10 +368,6 @@ _finish:
 
 static int gap_disconnect(struct btd_service *service)
 {
-	struct gas *gas = btd_service_get_user_data(service);
-
-	gas_reset(gas);
-
 	btd_service_disconnecting_complete(service, 0);
 
 	return 0;
Signature · 1 line
2.45.2
#1 lore raw

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=863185

---Test result---

Test Summary:

CheckPatch                    PASS      0.42 seconds
GitLint                       PASS      0.30 seconds
BuildEll                      PASS      25.24 seconds
BluezMake                     PASS      1704.22 seconds
MakeCheck                     PASS      13.18 seconds
MakeDistcheck                 PASS      177.53 seconds
CheckValgrind                 PASS      251.05 seconds
CheckSmatch                   PASS      354.30 seconds
bluezmakeextell               PASS      120.32 seconds
IncrementalBuild              PASS      1491.98 seconds
ScanBuild                     PASS      1009.63 seconds

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 8 lines · On Tue, 18 Jun 2024 15:59:14 -0400 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

Attributes only need to be read once after that they will be persisted by the core so there is no need to keep reading them on every reconnection.

---
 profiles/gap/gas.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Here is the summary with links:
- [BlueZ,v1] gas: Fix reading attributes on every connection

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0dc5bb2ed679

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html