Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] input: Reset report map state on detach
@ 2026-09-25 17:42 Giuseppe Piscitelli
  2026-09-25 17:43 ` [PATCH BlueZ 2/2] unit: Test HoG report map reads after reconnect Giuseppe Piscitelli
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Giuseppe Piscitelli @ 2026-09-25 17:42 UTC (permalink / raw)
  To: linux-bluetooth

From: Giuseppe Piscitelli <35407790+ooonea@users.noreply.github.com>

read_report_map() leaves report_map_id set after a failed read. Detach
cancels queued GATT operations but retains that ID, so a later attach
cannot request the report map again and never creates the UHID device.

Clear the ID when cancelling GATT operations on detach. This also lets
a reconnect retry a read that was still pending at disconnection.

A socketpair reproducer fails to read the map after either an ATT error
or cancellation before this change; both cases create UHID afterwards.
The existing HoG and UHID unit tests also pass.

Assisted-by: OpenAI Codex:gpt-6
---
 profiles/input/hog-lib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c
index 6c75c60..2b6dcae 100644
--- a/profiles/input/hog-lib.c
+++ b/profiles/input/hog-lib.c
@@ -1908,6 +1908,7 @@ void bt_hog_detach(struct bt_hog *hog, bool force)
 	}

 	queue_remove_all(hog->gatt_op, cancel_gatt_req, hog, destroy_gatt_req);
+	hog->report_map_id = 0;
 	g_attrib_unref(hog->attrib);
 	hog->attrib = NULL;

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

end of thread, other threads:[~2026-09-28 21:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25 17:42 [PATCH BlueZ 1/2] input: Reset report map state on detach Giuseppe Piscitelli
2026-09-25 17:43 ` [PATCH BlueZ 2/2] unit: Test HoG report map reads after reconnect Giuseppe Piscitelli
2026-09-25 20:05 ` [BlueZ,1/2] input: Reset report map state on detach bluez.test.bot
2026-09-25 22:03 ` [PATCH BlueZ v2 1/2] " Giuseppe Piscitelli
2026-09-26  1:30   ` [BlueZ,v2,1/2] " bluez.test.bot
2026-09-25 22:03 ` [PATCH BlueZ v2 2/2] unit: Test HoG report map reads after reconnect Giuseppe Piscitelli
2026-09-28 17:48 ` [PATCH BlueZ 1/2] input: Reset report map state on detach Luiz Augusto von Dentz
2026-09-28 21:03   ` Giuseppe Piscitelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox