Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2919193pxu; Mon, 14 Dec 2020 14:18:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqkJogtMPev/YWotpfMRv3Z3VMvt3OOYjPFXlVnpB6ANM+iXjqmZIJPVbxz94dmMPPe3jZ X-Received: by 2002:a17:906:890:: with SMTP id n16mr9021089eje.463.1607984333343; Mon, 14 Dec 2020 14:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607984333; cv=none; d=google.com; s=arc-20160816; b=CjC20y7fwSOxnSZ2MkjI3zzteqNpgZb3FYvzDUGcGlhl28DFRYPmW6MUr8v+bGnZcF k0/dOvXyztp/aybGiVE7x5q7EuGs4QMamyq3596SyKxFjotKD8Y55l6FaTtOjRrL1mCe AVScjTtRMjbQebHlaEaVBaHQUf3UdLNIaRHr2gE9t8fUU0bpS7rbLqd9MUfqN8I9gc43 2BXQ5/8Cj+BusI5o+IhP11WM6dyXilfyb3Z8itX4SU0Sdxsz4caN7hd7qIi1KVZFY6lF uJaibuAcdtmfuP1i0aPdlLE5HDxkqyvmPyg0QVaqcfUay22y4TB/FlA5QZyMgDHUKtcC hBWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4I36PkaRwnQEwK295eiTY/SP5cBZhbchCA7yLG6aQWo=; b=InHbqJfh5dx2nHh0bJGZDnTTtFeCEB5t1lJW6dfqm0KLCJa/F4B9h+J+sD4rdTdBmG yWEmjXymE4EEbALlrtMzKxUNvYOmYAGsCOtOooL80g+Ma5Q3rIs46CFQ72FyOKPwqEjr 00p+LuoN49Vx5VCinjp05sGN46Ws+zPKG7u7r8v/IuIxEY5K+BHgJu9aI8bw3OjzIDPa FVROdshMSdOzU9egYoL6XuqhVasPMKgglFgv2+CtxTSck4igwtu45+DoQS9TtqLi8IIA G3gT7RfKxVmshEdzuxXA0ZsWthiiDERhI8UX/E2CQE2shKV9LDNA3RkFM+M3HoY48Pw3 i+sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZBjvbsY3; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si11466843edg.1.2020.12.14.14.18.12; Mon, 14 Dec 2020 14:18:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZBjvbsY3; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440432AbgLNWQL (ORCPT + 99 others); Mon, 14 Dec 2020 17:16:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408480AbgLNWQA (ORCPT ); Mon, 14 Dec 2020 17:16:00 -0500 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85FC6C0613D3 for ; Mon, 14 Dec 2020 14:15:15 -0800 (PST) Received: by mail-pj1-x1041.google.com with SMTP id n3so985986pjm.1 for ; Mon, 14 Dec 2020 14:15:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4I36PkaRwnQEwK295eiTY/SP5cBZhbchCA7yLG6aQWo=; b=ZBjvbsY3p/1xqj4Kn1cLQ9ab33y8HgRgoXQ8Ss95DB39gjDhjK44QfZzNRjZkQZgwy UWaf2XJRbWgJdRnpmRH5T7Yj68nST55ryyN2wQcuZCjzr5Ss0WgZ328EZqhyxPeMH2BI PWMGY9tU328MYss0WnZq1m9Lfc8UlXnjhar78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4I36PkaRwnQEwK295eiTY/SP5cBZhbchCA7yLG6aQWo=; b=HGCmkomqjLxIjrFJYA1/V20YWyoOARrU7SPpFoRla5MNnGd1iVkBjeI43o1tc1gFyd FBG76QcDkKxD8SG6aADLxhlsGNjOwNGCpl2PcMQKWxC7QOTE2jw4f0N07Y5M5Fepz0xR 9amlwD6jVqXl9CHlAG20We+qFQOH2UPon7b6J3E9P873dhwiCHtndyprOK1P4gDItqWs fIbO9NFyyrJr0y0TZZsGno8pe3BJ4C0K+d1jBhEKcRq8ZpbQXhS944OEMwT6lMtovpVA MAuZ6fa6kxweWVkUwfDi34HMv1oTCeP66lhYhHXKrxKweqNbP0IEi8BM8zd7CxeOb2K8 /etw== X-Gm-Message-State: AOAM5310YKcYTn/FToIL+4fmEtExqOmg5WDR5SwJpFoPmbUkaccMrBWx CdJGo6kpucZh6kRgilL7nnmbS9j3cl/4+Q== X-Received: by 2002:a17:90a:dd42:: with SMTP id u2mr23470977pjv.125.1607984114607; Mon, 14 Dec 2020 14:15:14 -0800 (PST) Received: from sonnysasaka-chrome.mtv.corp.google.com ([2620:15c:202:201:4a0f:cfff:fe66:e60c]) by smtp.gmail.com with ESMTPSA id 24sm24297075pgy.45.2020.12.14.14.15.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Dec 2020 14:15:13 -0800 (PST) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka , Alain Michaud Subject: [PATCH BlueZ v3 1/2] Revert "input/hog: Remove HID device after HoG device disconnects" Date: Mon, 14 Dec 2020 14:15:01 -0800 Message-Id: <20201214221502.392676-1-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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 --- 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.29.2