Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp814828imw; Thu, 14 Jul 2022 11:14:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sgui0yhyXpjjYgB1OO4E0G/kvx0ylElV6JeYX5Ng1Joo5UYrQZk20PY1Qe/NS6SMzBCD6Q X-Received: by 2002:a05:6830:608d:b0:616:ecd7:de2 with SMTP id by13-20020a056830608d00b00616ecd70de2mr3884318otb.119.1657822479680; Thu, 14 Jul 2022 11:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657822479; cv=none; d=google.com; s=arc-20160816; b=Fr0pwJOMBlCtikgCTQsP9jhEjQUv5ABhnf7LfPBhR85HR6wjfPhqtGG2ghO01r88O1 gcmNAkPxoPUebgI+X90S3mPD1nbPtP6Lsc931WcD6Gqt6+vgUnYhtf1RQ27JhIfNCRT2 +SaSl9ky2I6okKc5720DmerrC+Qic8/llk+pL0coGzBIlwjt6nsSC/9aYPx5FaGq01jC 8Wa0ugbspBPp6CqhYXpOtRL+mOtshoSOQpcg/+tFv1pOY0eHlwVmRk7yfJoNW293+vFF FaVyStSwKIFJLcI1a3bNxILr1v2cFx+KbaW4Ank/lVNfv+kKKzcjr2KzW/MMld9ixSzl BihA== 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 :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=pZ7v0vZV1thkYyQOYQQJmubsK+Pvzo0Wu/qOpv54A+U=; b=arun7mX6OYcDJlCdckeF/BHel2Ez9Z7pQrbI+d6D9WIlLKA0okKs4juERD1U8xdwEX UtKfuwev4gLE5J31gzebbaMxpDwHcF6PGm21Ngq8Pcu3Tfdyr+mdXsmMUBvurb4KT6P9 BvdPEebnATsHRDZdfmanJMaTqoOOGrWLB/U+yxbRX067poZFScY76XQSuFV93l+Nocc7 lPTBGl7JuZGMdp5B04Zl6X0Fh/jPMtJjMTgw/ho317hOUjfbpERSOvqIve0KEjZ8f45O MC3nISXvXJ71OPCNvgrLcV+ZLv3Z39OMHUt5J5g0w8ub555RUYH9R+1tMpwldaCeJu5P IJSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PPThfFWv; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c8-20020a544e88000000b00335251db61asi1927235oiy.178.2022.07.14.11.14.25; Thu, 14 Jul 2022 11:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PPThfFWv; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240539AbiGNSMa (ORCPT + 99 others); Thu, 14 Jul 2022 14:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240553AbiGNSM3 (ORCPT ); Thu, 14 Jul 2022 14:12:29 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AAAD68DE6 for ; Thu, 14 Jul 2022 11:12:28 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id y9so2540166pff.12 for ; Thu, 14 Jul 2022 11:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=pZ7v0vZV1thkYyQOYQQJmubsK+Pvzo0Wu/qOpv54A+U=; b=PPThfFWvADwd7BLjI8kzelc71BTiQj6sudNiTvYyncJ+6AhBPnYuqgQ5I7ZZjA7Id9 8ThwTd52wQ2Xt0dEkriR0klyq7PvdqgnDSxLE9Iy5e3C1xW9lBoWkCRGwlw5S44/wesu gFw/WDqIm5ZxQuk6GY9hU//ICjVRt4UPZTNZ5iXTDnPRjPYgcgUh427hu+8eUeylfSca AgyVd1R8DTPCn/isCtUyrqAQy7wDmD3ThfpI+0KQRc/I/AuT0g0DRk+2gaJB70zGyhLO w/53hFtey0CsfFxF7fMIvKjR6E2Hrf1E3r/a919sFMLSAFxnBcx2voIMRGKazGeaWQhK PgLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pZ7v0vZV1thkYyQOYQQJmubsK+Pvzo0Wu/qOpv54A+U=; b=PDMedIBriiqvhYJHN2VsqvqL+nTI++KoV/6sRyfuSwM05TjSQuK6N7xqQbyAXOf0d+ q2Dva9Ih709BYl1fxGMXqYIu616ZY3Zp3LzV4y5vyrNwkoxzuJbnsnKBLakLCiGhu7mX KWIhkxqjuJYa3/ngbuy8dr/lSExy3qVkcU/neSFiLPDocPyTwHDOF6v0vdc4FMohLNhD +7pdhfVvi2kDlQL7A6tKbhbYgkzu8QkeE4wBYVvc52vowWWcBw45UpwJbmTahR7RHJuk 1BrgJhE5haY4F4ALJg2P6WmeEOZH/8Ro4j2xjB2k4GaIVRo1gl84q9rhUOzB503FKk2L ojvQ== X-Gm-Message-State: AJIora+K2b+rWN8z8t1mtPX1y4PbKgky2Gk/InHaseMa8fbdnBI0FcIX hwGhO6Z+4z9acXPpOcf6RLo6DGJwNzQ= X-Received: by 2002:a05:6a00:812:b0:52a:da89:d201 with SMTP id m18-20020a056a00081200b0052ada89d201mr9526166pfk.57.1657822346830; Thu, 14 Jul 2022 11:12:26 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id l4-20020a170903244400b0016bf24790e4sm1833145pls.21.2022.07.14.11.12.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 11:12:26 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v2 2/2] Bluetooth: hci_sync: Don't remove connected devices from accept list Date: Thu, 14 Jul 2022 11:12:24 -0700 Message-Id: <20220714181224.3793757-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220714181224.3793757-1-luiz.dentz@gmail.com> References: <20220714181224.3793757-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz These devices are likely going to be reprogrammed when disconnected so this avoid a whole bunch of commands attempt to remove and the add back to the list. Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_sync.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 256ece5640b7..c746714f218f 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -1892,12 +1892,15 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev) } /* Go through the current accept list programmed into the - * controller one by one and check if that address is still - * in the list of pending connections or list of devices to + * controller one by one and check if that address is connected or is + * still in the list of pending connections or list of devices to * report. If not present in either list, then remove it from * the controller. */ list_for_each_entry_safe(b, t, &hdev->le_accept_list, list) { + if (hci_conn_hash_lookup_le(hdev, &b->bdaddr, b->bdaddr_type)) + continue; + pend_conn = hci_pend_le_action_lookup(&hdev->pend_le_conns, &b->bdaddr, b->bdaddr_type); -- 2.35.3