linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] Revert "input/hog: Remove HID device after HoG device disconnects"
@ 2020-12-09  1:00 Sonny Sasaka
  2020-12-09  1:00 ` [PATCH BlueZ 2/2] input/hog: Cache the HID report map Sonny Sasaka
  2020-12-09  1:56 ` [BlueZ,1/2] Revert "input/hog: Remove HID device after HoG device disconnects" bluez.test.bot
  0 siblings, 2 replies; 7+ messages in thread
From: Sonny Sasaka @ 2020-12-09  1:00 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] 7+ messages in thread

end of thread, other threads:[~2020-12-12  1:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-09  1:00 [PATCH BlueZ 1/2] Revert "input/hog: Remove HID device after HoG device disconnects" Sonny Sasaka
2020-12-09  1:00 ` [PATCH BlueZ 2/2] input/hog: Cache the HID report map Sonny Sasaka
2020-12-09  1:57   ` Luiz Augusto von Dentz
2020-12-11 23:31     ` Sonny Sasaka
2020-12-12  1:11       ` Luiz Augusto von Dentz
2020-12-12  1:15         ` Sonny Sasaka
2020-12-09  1:56 ` [BlueZ,1/2] Revert "input/hog: Remove HID device after HoG device disconnects" bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).