* [PATCH BlueZ v1] monitor: Fix not loading local GATT DB from cache
@ 2026-04-06 20:00 Luiz Augusto von Dentz
2026-04-06 20:55 ` [BlueZ,v1] " bluez.test.bot
2026-04-07 13:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2026-04-06 20:00 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The local GATT DB maybe discover in previous connection and therefore
should be cached as well to be able to decode follow-up connections
where the discovery may not be visible.
---
monitor/att.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/monitor/att.c b/monitor/att.c
index e76cb44d28f5..e8e0d499a826 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -412,12 +412,24 @@ static bool match_cache_id(const void *data, const void *match_data)
return !bacmp(&cache->id, id);
}
-static void gatt_cache_add(struct packet_conn_data *conn, struct gatt_db *db)
+static void gatt_cache_add(struct packet_conn_data *conn, struct gatt_db *ldb,
+ struct gatt_db *rdb)
{
struct gatt_cache *cache;
bdaddr_t id;
uint8_t id_type;
+ /* Attempt to cache local db if not empty */
+ if (!gatt_db_isempty(ldb)) {
+ cache = new0(struct gatt_cache, 1);
+ bacpy(&cache->id, (bdaddr_t *)conn->src);
+ cache->db = gatt_db_ref(ldb);
+ queue_push_tail(cache_list, cache);
+ }
+
+ if (gatt_db_isempty(rdb))
+ return;
+
if (!keys_resolve_identity(conn->dst, id.b, &id_type))
bacpy(&id, (bdaddr_t *)conn->dst);
@@ -429,7 +441,7 @@ static void gatt_cache_add(struct packet_conn_data *conn, struct gatt_db *db)
cache = new0(struct gatt_cache, 1);
bacpy(&cache->id, &id);
- cache->db = gatt_db_ref(db);
+ cache->db = gatt_db_ref(rdb);
queue_push_tail(cache_list, cache);
}
@@ -437,8 +449,7 @@ static void att_conn_data_free(struct packet_conn_data *conn, void *data)
{
struct att_conn_data *att_data = data;
- if (!gatt_db_isempty(att_data->rdb))
- gatt_cache_add(conn, att_data->rdb);
+ gatt_cache_add(conn, att_data->ldb, att_data->rdb);
gatt_db_unref(att_data->rdb);
gatt_db_unref(att_data->ldb);
@@ -520,6 +531,10 @@ static void load_gatt_db(struct packet_conn_data *conn)
cache = queue_find(cache_list, match_cache_id, &id);
if (cache)
data->rdb = gatt_db_ref(cache->db);
+
+ cache = queue_find(cache_list, match_cache_id, &conn->src);
+ if (cache)
+ data->ldb = gatt_db_ref(cache->db);
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [BlueZ,v1] monitor: Fix not loading local GATT DB from cache
2026-04-06 20:00 [PATCH BlueZ v1] monitor: Fix not loading local GATT DB from cache Luiz Augusto von Dentz
@ 2026-04-06 20:55 ` bluez.test.bot
2026-04-07 13:30 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-04-06 20:55 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1311 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=1077784
---Test result---
Test Summary:
CheckPatch PENDING 0.32 seconds
GitLint PENDING 0.36 seconds
BuildEll PASS 20.56 seconds
BluezMake PASS 655.19 seconds
MakeCheck PASS 18.10 seconds
MakeDistcheck PASS 243.21 seconds
CheckValgrind PASS 297.43 seconds
CheckSmatch PASS 349.29 seconds
bluezmakeextell PASS 181.12 seconds
IncrementalBuild PENDING 0.33 seconds
ScanBuild PASS 1028.57 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
https://github.com/bluez/bluez/pull/2022/checks
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ v1] monitor: Fix not loading local GATT DB from cache
2026-04-06 20:00 [PATCH BlueZ v1] monitor: Fix not loading local GATT DB from cache Luiz Augusto von Dentz
2026-04-06 20:55 ` [BlueZ,v1] " bluez.test.bot
@ 2026-04-07 13:30 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-04-07 13:30 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, 6 Apr 2026 16:00:43 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> The local GATT DB maybe discover in previous connection and therefore
> should be cached as well to be able to decode follow-up connections
> where the discovery may not be visible.
> ---
> monitor/att.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
Here is the summary with links:
- [BlueZ,v1] monitor: Fix not loading local GATT DB from cache
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a73fcbf207d3
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:[~2026-04-07 13:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-06 20:00 [PATCH BlueZ v1] monitor: Fix not loading local GATT DB from cache Luiz Augusto von Dentz
2026-04-06 20:55 ` [BlueZ,v1] " bluez.test.bot
2026-04-07 13:30 ` [PATCH BlueZ v1] " 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