Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1647196pxu; Sat, 12 Dec 2020 21:57:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJydVEoLbP3FGArofYHVXLlk37ZFUKwncvPccAjAwv0bl/mVHi8bTU/2BmOKOWSW8mZjb7Ku X-Received: by 2002:a05:6402:1ad1:: with SMTP id ba17mr18921842edb.51.1607839066468; Sat, 12 Dec 2020 21:57:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607839066; cv=none; d=google.com; s=arc-20160816; b=sbGCrsJbk33vPPwRN+54bXdPkQaJIOSbfNA4+0JqzuCfpROmstxTgnT5iDfeCPXHLk iwcUlpP4QXjkBVY/xEL2WSsuXpWm8pkvLIXnAspbumpNYz/UQqaa0G27NsYWM5E87ymc OBnvf9zmljqY6Fm/sz4O8WhJqr7tQWFOG/5FU+zDTtxC5ElFyqb1PJqnmkW+We0zuxY5 zlR7QuemknSkqfEB7eKNaJVHsWNINgC3DKBTvo6HiV18s5YQeh5hEZ4ubbbASRdcCy4R fzFoFRe+CLnRghqS80DHkUS1wQRDm/CyKHIyXcwLL1zcF2ud3RK+nqzSZxY1BXbm873p FP2w== 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=u3YSqH1FiIVrSIBPKfpTCG/uhni00GyHzVDOAjTchBw=; b=AtqE7/Ulh/vrJpCnOXkEz77F7lDDx52HNn/5kWpbgG8+qpN0CHBYUyii7vBDC9a7/h ZwFnMjxf6YDGXiIhPrfSXSFH/Aeu2lgJzU5/4H3tK9xdPts/eRzqgk79o5oq7VGNOA5m GXr5ihC4dTDAWqSPmPHDoha/npHkWrTIPs0BXo8tKI0/6akjh01qqO9wwffhhLPzJhvI mFJVtJyjX5P6dRXhGt39bbjzrdByj5dP6+6Ujtk9EzZyTCDuq1hyAnzBWjNlbEPkpAYL mrJN3H7C8Ctn5b+7Q089PPV8FcfZ6PuBWEHarOPiWveVBHZn25H8+qzOcnk8VSwug8oG B4Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RGPJPfkZ; 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 a8si8765250ejx.247.2020.12.12.21.57.23; Sat, 12 Dec 2020 21:57:46 -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=RGPJPfkZ; 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 S2437194AbgLKXcJ (ORCPT + 99 others); Fri, 11 Dec 2020 18:32:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437052AbgLKXbj (ORCPT ); Fri, 11 Dec 2020 18:31:39 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23BA5C0613CF for ; Fri, 11 Dec 2020 15:30:59 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id s2so5378608plr.9 for ; Fri, 11 Dec 2020 15:30:59 -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=u3YSqH1FiIVrSIBPKfpTCG/uhni00GyHzVDOAjTchBw=; b=RGPJPfkZlJLwx4Q6e1y9Dx0lvbAOuZYbLzItcTlQlPvnivlhvgp0uieZ/S9R93JfbD mKi0p+3JMakJgdc1fJMjyUxEnBXyjI7JNbwI5880Si6NaSFNiR+kkZD6d9q3dAtSUDMG ziv6TMx3Xgb5RE8GgcJyBS+dU47tUp6j/+xgQ= 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=u3YSqH1FiIVrSIBPKfpTCG/uhni00GyHzVDOAjTchBw=; b=JnkSRyRRK0upET6jR8Rp/cHPnEpWNDSnYqVVxoSP+At3vJvS/aMfFBEvp13ds6Z+Co 57/tr/qavW+5SHODwpi8PDv6gi7el4DRz6/SSDTjvK1j2lg870hEYLml/tFg467gKe0n XzWJpsjpOaobfM0lOOiz+D8ifotBBuynyivGRkl7TEvUXUhkzqzC416s/cMngW2RD/Rv tiTPnGxK4lReYA0pwqLjtKuTcJ57CX3I8RZlHjH14YK81EYMihuqPr0ZHYexnjTFDb4A F6UKOInQwaaPcrgBf+bBIe/sNOqCTlCZqjngzI0L2t6y7Wbhko0J6Pp3ygvlgxYwkxtc HnHQ== X-Gm-Message-State: AOAM533EmWHFZc2Scz6Rnzj8hK7B898ROanIMtskgJBePym16I2LK7Ws GY7YJztFSdmtFpHtsNRrVTCduFxUCiAViw== X-Received: by 2002:a17:902:bf44:b029:da:d0ee:cef with SMTP id u4-20020a170902bf44b02900dad0ee0cefmr9769527pls.12.1607729457660; Fri, 11 Dec 2020 15:30:57 -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 y15sm11015450pju.13.2020.12.11.15.30.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Dec 2020 15:30:56 -0800 (PST) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka , Alain Michaud 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 Message-Id: <20201211233047.108658-1-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.26.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.26.2