Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3611558pxu; Tue, 8 Dec 2020 17:16:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzlmDt2UuJaz1DqMACUkj/7eJfQDb65ix7j76UHxGHs6s7SYBUC4cmsq27Bzd+8rc3UQf/ X-Received: by 2002:aa7:d64d:: with SMTP id v13mr632266edr.196.1607476615193; Tue, 08 Dec 2020 17:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607476615; cv=none; d=google.com; s=arc-20160816; b=jCLZwpiXH73XSuRAQQFQNpG32GZnszcyW/tHn5Efh37ixW/UXMPSX/XeaiSvK/WVpm RjHYw9QlgSE+wcy1VHWNBFXJVJQINZ3SEp82G/8VvXT0rRItSX4zji4+xnSsvGS3boNq SGKkbJGSujUNxMgDOgoQdqd1tQeZBN0l6JNciw0CQtBC0ISobbPrih1hsZR5W41EGXob p2307n0UANXA8OPAFq1TfYD4v8mRGjRN7FmDPikg5QEcA2CkEXqOj0vjFQ6Z65rTQ5TH ZjzI7qlEhZ9PdOiJqt+dMKEC0ZVGyF+V64fcUkvmrooCwqkPNUAcOU721bRxlklsmnId 6cyA== 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=vL6XBB9JiAvKx5HlRWnhUKtDveOxRjFJiKOD1RC40xkZvJoUrfzIEdmv7PN0S+1UmM aKElag/eQZTfWAeBkWYvd9t8n+l6opPmhuC55NWUU7N+cn7ABmyOP/K4Typ/WPP6CvXO wKeS39Ku+qvcBB7WgM2edSuX/RttZlbiuy2i8cXBDU5l0iMjEdanLdL8beHI9lLVumiO k29b21cndXfO6P+yNk78sJg3NmWN9ZbWN0QrsBXfAh2eRnpDF5yfJ8rN5bv2o+sDEyfk VtgAuxVt7gN2Y4QT5R8/e11RWmGzq5ZH/xYO/83gDhDKtTciwlC7ac6mT71aaCDtwGsC iDHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TCd+sqLJ; 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 zn8si92831ejb.299.2020.12.08.17.16.31; Tue, 08 Dec 2020 17:16:55 -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=TCd+sqLJ; 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 S1726352AbgLIBBf (ORCPT + 99 others); Tue, 8 Dec 2020 20:01:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbgLIBBb (ORCPT ); Tue, 8 Dec 2020 20:01:31 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB9C4C0613CF for ; Tue, 8 Dec 2020 17:00:45 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id 4so49511plk.5 for ; Tue, 08 Dec 2020 17:00:45 -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=TCd+sqLJKgzH3YdAR1aQQlQDSFRyteDmiTBk9ZwNV5Au9xV70009L6+vyhTL5TKsep oBOesgxlRQ2JmCEkoFgqUMtHfK8/O82z+PTfJD8FkXwhIkUJrVaEZR71pl4Ap9oU15fs insmoGzWDlfD5CBzSYvgoqFM8gNm+ddxAz8hE= 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=NWlbIEqW2xLoapc1b/5OIlwFUi4ddISbnmCh0UKRPn41+JAgDRhmGx1+/MGcBeGBAm vGCm6j3qKs944EOsCX/ayGxJA0++nksW8rvteSaGgT0LnpH0J7Z9kNEAiNL/CsPiVEUz sGK2739ci6QH0yNrJnfU5YhfxRE1agcGjkTNzfmsx629lCwVB82P064axMGOX+OW3yhU nfQ875sCW26TsWmLCYOy2IxkGiX/+Rm73o9SP2GHoRCY/BykizDIUopEmlCm1tQEKTXh 6Ah8v4kfRUNGWXhMO9+uFgmGb3zLNok4uhDeGwGTCvJwAPfG5zVIumWntjulIFA8rus1 JYbw== X-Gm-Message-State: AOAM533ayAqPG0fQZ1oRTfivRXcsp458b/K0IuJ3KKnn5fVSsAQwhdc6 lg9fguYI8TFOflRxU1oFaxRwmc352csAcA== X-Received: by 2002:a17:902:82c8:b029:da:eead:94a0 with SMTP id u8-20020a17090282c8b02900daeead94a0mr83955plz.42.1607475644911; Tue, 08 Dec 2020 17:00:44 -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 5sm28052pfw.12.2020.12.08.17.00.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2020 17:00:44 -0800 (PST) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka , Alain Michaud Subject: [PATCH BlueZ 1/2] Revert "input/hog: Remove HID device after HoG device disconnects" Date: Tue, 8 Dec 2020 17:00:29 -0800 Message-Id: <20201209010030.342632-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