Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp480453rdd; Tue, 9 Jan 2024 09:49:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRWldTZo+miqPL/Xl9/sWllntvO3am/UXRnMakAmB7VtveNr35bKXKHRfl0/vr5kACtVc9 X-Received: by 2002:a05:6a21:8187:b0:199:b898:c66c with SMTP id pd7-20020a056a21818700b00199b898c66cmr2211437pzb.112.1704822589879; Tue, 09 Jan 2024 09:49:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704822589; cv=none; d=google.com; s=arc-20160816; b=atMY+B44QpDXmrxmbgSthX10CetqbRxiEPm+1MFNonQP56bJuJjHl9SbqR04scaFpQ ua2bLP1fOLj1tSOjFXbEkpgzSPjgx4Nu4/ab9tF0+QixNyPL0MSBQVMJiRUiatneQgjV aHpnCeV8tQXP9ssl5eQl3Z+kLuFA8PE4rRuyr0Qkf3Y4j1I6vvauezJN88sfyDgxrD6I SNNykeAPbadRE74VJ5iLnyQtyaoZv/OTJbkJla2CwB+BnyY54yzpyTeNbCCXX4NtKGqF 8tSIHhzW83iyNQSUBPq2z+rT+JOldWJn7Tod//SUQi4EY5JQu8DHWXFCxiK2ui1w7kic l82Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=O9VWxaOqAp8yt9/GjSW4V6FFOkCfgXsvX1IU679pRv4=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=wJRbfdemCIlkNgwsEJr7HoxwF2ooB/1vZ1FwnNX6GrntJPOjRm9tIz7c65bZrWj094 GPQdlM09b6zJQ92oS3SHiPMjuceqRFc61ScsRvxsIpn6qWu5XU4RP848Fo8uuDk/pvoO GRja3QYlIGuVdfh9UcgXlkQiJzjiGqfWMHMK2fpsPcQNHonnLMOnKQ8xJr1ZzQyPM3vc YYzjSNiJhzAxitcaB7HFO/G7SyRviOydswxWZVlEL+IGDk1IIcvf7glx7JEqfYWz5T4X fYqcAb/aGSPGJ1YXSzS3LQdPrdsNVqOXPbvzn4/1TLfQna+TZnIN5RxMwkqVRALSH0LJ d4lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FETrJKWU; spf=pass (google.com: domain of linux-bluetooth+bounces-1002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y12-20020aa79e0c000000b006dad16336f3si1776358pfq.5.2024.01.09.09.49.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 09:49:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FETrJKWU; spf=pass (google.com: domain of linux-bluetooth+bounces-1002-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1002-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7C69B28641E for ; Tue, 9 Jan 2024 17:49:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C9A03BB41; Tue, 9 Jan 2024 17:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FETrJKWU" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 818DC3BB3D for ; Tue, 9 Jan 2024 17:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-595d24ad466so1902619eaf.0 for ; Tue, 09 Jan 2024 09:49:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704822571; x=1705427371; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=O9VWxaOqAp8yt9/GjSW4V6FFOkCfgXsvX1IU679pRv4=; b=FETrJKWUS6PP32QshfX6pw/8CPOjFvbMPV5nCp6aHB50vi34WEwi/b3N6a0h8Besy2 y2V2qpdoDnMvkmAM6mzNqa4N8X3T85A8kO5BnmMcTm3ND3xnebXAvOFI3QTQ06ARGDNa YBDtBzjHGtXikF9f7T2Ryjs7bD3lvV2NkP8PatndrCtCqrg/23+doiQf2eOPIaPdNjXY n5QW5pBTbaIwM8r8yEI/M8KpjrvNnVqim44SK/xhTrlFwIeZieTd2QnQjLEBygP3Hetp Vad1+GIeA2Rpsj27wiFrcYMF0aSu6V/cckDT/COewkgneRiwoPjbEft17DBQGdb13MaC Y8PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704822571; x=1705427371; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O9VWxaOqAp8yt9/GjSW4V6FFOkCfgXsvX1IU679pRv4=; b=IGeVNPsKN/y1M+Py130T7tbaWeTDY5S/tn4OsHn4Sw5qR+TTEJ3A+v7eW3VTeXpve1 BYaHauarJc8OuTon/g7oYzLabb0jj0gjkIQJSfTFmINmBigtQB0MPJ3IMAyIIBUMDMbo IwAnAQlfiLHA4RgWE//gvWG2V/zavVJUBZtSVkEc4bnRXctFO086Mo7vFcObqhTZhzaE v1pFWcbokmbNxz+qfhyt+uqDZkLmuf0hmAskfsxNshq14Uc7pZxX4MS4IFnpapG+uu6b q1/Pjd+bLu8LppBCuPwJj0aEE7Lqw3R+w2XUfAoZB7wYGItG8kLjFXHrQ29AXwgLYtXz fhqg== X-Gm-Message-State: AOJu0YzP9EQzTqp/RneUZqgMaVRKev3eUvCWGQlb/c9ipHDqLHbrQKKV Q2E8zXx2OaFisHeT1rWQGbcuX+KDG/w= X-Received: by 2002:a4a:ac49:0:b0:595:d85:260a with SMTP id q9-20020a4aac49000000b005950d85260amr3853472oon.2.1704822570920; Tue, 09 Jan 2024 09:49:30 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id o184-20020a4a44c1000000b00595e66557e6sm476814ooa.6.2024.01.09.09.49.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 09:49:30 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v4 1/4] Bluetooth: Remove superfluous call to hci_conn_check_pending() Date: Tue, 9 Jan 2024 12:49:25 -0500 Message-ID: <20240109174928.488595-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Jonas Dreßler The "pending connections" feature was originally introduced with commit 4c67bc74f016 ("[Bluetooth] Support concurrent connect requests") and 6bd57416127e ("[Bluetooth] Handling pending connect attempts after inquiry") to handle controllers supporting only a single connection request at a time. Later things were extended to also cancel ongoing inquiries on connect() with commit 89e65975fea5 ("Bluetooth: Cancel Inquiry before Create Connection"). With commit a9de9248064b ("[Bluetooth] Switch from OGF+OCF to using only opcodes"), hci_conn_check_pending() was introduced as a helper to consolidate a few places where we check for pending connections (indicated by the BT_CONNECT2 flag) and then try to connect. This refactoring commit also snuck in two more calls to hci_conn_check_pending(): - One is in the failure callback of hci_cs_inquiry(), this one probably makes sense: If we send an "HCI Inquiry" command and then immediately after a "Create Connection" command, the "Create Connection" command might fail before the "HCI Inquiry" command, and then we want to retry the "Create Connection" on failure of the "HCI Inquiry". - The other added call to hci_conn_check_pending() is in the event handler for the "Remote Name" event, this seems unrelated and is possibly a copy-paste error, so remove that one. Fixes: a9de9248064b ("[Bluetooth] Switch from OGF+OCF to using only opcodes") Signed-off-by: Jonas Dreßler Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_event.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 22b22c264c2a..23e0e63ac312 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3556,8 +3556,6 @@ static void hci_remote_name_evt(struct hci_dev *hdev, void *data, bt_dev_dbg(hdev, "status 0x%2.2x", ev->status); - hci_conn_check_pending(hdev); - hci_dev_lock(hdev); conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); -- 2.43.0