All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sonny Sasaka <sonnysasaka@chromium.org>
To: linux-bluetooth@vger.kernel.org
Cc: Sonny Sasaka <sonnysasaka@chromium.org>,
	Alain Michaud <alainm@chromium.org>
Subject: [PATCH BlueZ v2 1/2] Revert "input/hog: Remove HID device after HoG device disconnects"
Date: Fri, 11 Dec 2020 15:30:46 -0800	[thread overview]
Message-ID: <20201211233047.108658-1-sonnysasaka@chromium.org> (raw)

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


             reply	other threads:[~2020-12-11 23:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 23:30 Sonny Sasaka [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201211233047.108658-1-sonnysasaka@chromium.org \
    --to=sonnysasaka@chromium.org \
    --cc=alainm@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.