Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp945492pxf; Wed, 7 Apr 2021 15:46:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX4+JDdlXLVzXEYs+nETcAt+IY4rO2FlqfQCvAkGkiEQmfX2Kn+TvsosKREZtq9vjjnFDc X-Received: by 2002:a17:906:398a:: with SMTP id h10mr6556280eje.155.1617835571272; Wed, 07 Apr 2021 15:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617835571; cv=none; d=google.com; s=arc-20160816; b=zDhFx7qoRPSn9scK16H/gTzwnSj78sL0TSZ5CznpL+463aN5gPbLkI47GpccjKG+sn aFO6jVWCmjxvkq7GvvbN8ewKKrRsGH19rs1v2zmlR/FJktwp7zwJa+rLanyWxexmJYzq kYkEBcsPt3Uded3EQylpi7yxQ6fqa8DQO0tWmfJYghp19hxWUI7YJULf72bJIJLxFtB5 1miYc2LUF4YreqZvSQ1Mo/59+vYrcASvRpLVlyXu+yQIhfYnMSY5H1DGmMEWR6RjEnaP MRiaDKpe5U+kYBmM8zkaMJmYfTP1xwNM7enMc6UNk+W6+BiTx1UsNTwlQ/BO5DntkYgu nJCg== 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=zuQW1FRJ4BKg923uSrgEDFi7TIEspcjzj26BamHN6YE=; b=zqNaa8vEl6inVDz0O/+Y3g+Km5ohXs/eJFohLQ/m78fNCuGX3U0p9rOPXl6tL1Eupl Eq8yL69njVf8fXAuNE7dlXhsg98SoH5L+5XICr7enpyNkDUnBVZYVeUflJI2gV2df8yg iIUjice6UVRSTtDrprdunLzrS0CLIbW2ui/450FNfg9lWFbgVDdpli4kP1eoaDXPGLc5 ZwLJ7ObwRgbDRxLq2Y76De0rlGM78R+58/mZJNQ9yYVFn3aMw+GSEpFk/ndEIonHRAId NG/jKPdrkXY53jCB9UnkVK4gIfI7nFHRWTY0nrh4RfGfhKnfszmBCyhIli7amunPkzHg In5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Fid4GJqL; 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 lj17si10854925ejb.219.2021.04.07.15.45.47; Wed, 07 Apr 2021 15:46:11 -0700 (PDT) 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=Fid4GJqL; 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 S229968AbhDGWed (ORCPT + 99 others); Wed, 7 Apr 2021 18:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbhDGWec (ORCPT ); Wed, 7 Apr 2021 18:34:32 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DAD4C061760 for ; Wed, 7 Apr 2021 15:34:22 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id ot17-20020a17090b3b51b0290109c9ac3c34so2068831pjb.4 for ; Wed, 07 Apr 2021 15:34:22 -0700 (PDT) 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=zuQW1FRJ4BKg923uSrgEDFi7TIEspcjzj26BamHN6YE=; b=Fid4GJqLwMXo2iFb3MJj5yN1n2t7MbVD3TnF3NU8jAH8m2uM/3D+EWs4zATDUj0bQD xxCk//QNElqxDMXcV3Z+F69t5QWzJwo2pHY36n0AmMEffG7qbXoyI1dUIqf8GKaiQjwl oMSjXyoHe6oa1t5KcJBU2Kh6zDw2A7Cyumj/s= 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=zuQW1FRJ4BKg923uSrgEDFi7TIEspcjzj26BamHN6YE=; b=eHjY6igIST+WeLo82MQzj4Qjw6VWKsnk9GAJBkZV2TEG4I/0xJjbkDtdklf0X+jovM Q1oMQ0TCyWxxslYRVYj5PFHy1cYc4a1qMj6h4HcIMRdPcE1J8J9IYdhH9bemAExr+5tQ 7wLClSN+YH21dwL++katAYvPV13ggCiLqEXiFZukIg5ry/dJ12toWY59E5ldJTc0tqOX nhRRD5CuHRlJxUxhyIog7BT70vEXFRcpn5BXhSicKvF3Z2EQmTzAwaTgDmLsUjfnJV+u jDmdFe3TsxyDhfkpRn084J7YURAFs/hOAoX0sEU1DSRYyEPfFfEQsDmRnl4bBD8U+GoP 0dBw== X-Gm-Message-State: AOAM531zOdnNC5xqlSkIAZy15QjizUhxKRdDzxyFTBKuXIKwMfXPjUuN MRp3VgxYSc6u0eCB7bThFhp5lX2qYjep0w== X-Received: by 2002:a17:90a:f0d1:: with SMTP id fa17mr5306612pjb.155.1617834861753; Wed, 07 Apr 2021 15:34:21 -0700 (PDT) Received: from sonnysasaka-chrome.mtv.corp.google.com ([2620:15c:202:201:c572:df03:d9fe:57c5]) by smtp.gmail.com with ESMTPSA id t24sm4563359pgi.30.2021.04.07.15.34.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Apr 2021 15:34:21 -0700 (PDT) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Dmitry Torokhov Subject: [PATCH BlueZ] input/hog-lib: avoid scanning characteristics too early Date: Wed, 7 Apr 2021 15:34:18 -0700 Message-Id: <20210407223418.28793-1-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Dmitry Torokhov We need to have active connection to fully discover a HOG instance, and in the chain bt_hog_new()-> gatt_db_foreach_service()-> foreach_hog_service()-> hog_attach_instance() we have not set up hog->attrib yet. So let's skip calling foreach_hog_chrc() from hog_attach_instance(), especially since we will be calling bt_hog_attach() pretty much immediately after bt_hog_new(), and we will be discovering characteristics there anyway. --- profiles/input/hog-lib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/profiles/input/hog-lib.c b/profiles/input/hog-lib.c index 6ac14e401..a9ecabad0 100644 --- a/profiles/input/hog-lib.c +++ b/profiles/input/hog-lib.c @@ -1428,7 +1428,6 @@ static void hog_attach_instance(struct bt_hog *hog, if (!hog->attr) { hog->attr = attr; - gatt_db_service_foreach_char(hog->attr, foreach_hog_chrc, hog); return; } -- 2.31.0