All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/2] Revert "input/hog: Remove HID device after HoG device disconnects"
@ 2020-12-11 23:30 Sonny Sasaka
  2020-12-11 23:30 ` [PATCH BlueZ v2 2/2] input/hog: Cache the HID report map Sonny Sasaka
  2020-12-12  1:13 ` [BlueZ,v2,1/2] Revert "input/hog: Remove HID device after HoG device disconnects" bluez.test.bot
  0 siblings, 2 replies; 6+ messages in thread
From: Sonny Sasaka @ 2020-12-11 23:30 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Sonny Sasaka, Alain Michaud

This reverts commit d6cafa1f0c3ea1989f8a580e52f418b0998a3552.

In commit d6cafa1f0c3e ("input/hog: Remove HID device after HoG device
disconnects"), the bt_hog structure is destroyed in order to fix a bug
where the UHID connection is not destroyed. This fix has the cost of
increasing reconnection time because every reconnection would need to
re-read the report map again. An improvement to this fix is, instead of
removing the bt_hog structure, we can just destroy the UHID with
UHID_DESTROY event and use the existing bt_hog structure to keep the
cache of the report map to avoid re-reading the report map at
reconnection.

Reviewed-by: Alain Michaud <alainm@chromium.org>

---
 profiles/input/hog.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 91de4c70f..d50b82321 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -207,8 +207,6 @@ static int hog_disconnect(struct btd_service *service)
 	struct hog_device *dev = btd_service_get_user_data(service);
 
 	bt_hog_detach(dev->hog);
-	bt_hog_unref(dev->hog);
-	dev->hog = NULL;
 
 	btd_service_disconnecting_complete(service, 0);
 
-- 
2.26.2


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

end of thread, other threads:[~2020-12-14 22:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 23:30 [PATCH BlueZ v2 1/2] Revert "input/hog: Remove HID device after HoG device disconnects" Sonny Sasaka
2020-12-11 23:30 ` [PATCH BlueZ v2 2/2] input/hog: Cache the HID report map Sonny Sasaka
2020-12-14 18:20   ` Luiz Augusto von Dentz
2020-12-14 18:22     ` Sonny Sasaka
2020-12-14 22:16       ` Sonny Sasaka
2020-12-12  1:13 ` [BlueZ,v2,1/2] Revert "input/hog: Remove HID device after HoG device disconnects" bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.