Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1804101rdb; Mon, 8 Jan 2024 10:40:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwqaEKUNWQnuraSK31mL+C8eimdp4SzzUI0imZCdi0MaSN+xHwloZJGQ37AWVoyI6BKoom X-Received: by 2002:ae9:f40c:0:b0:783:26c0:5ae with SMTP id y12-20020ae9f40c000000b0078326c005aemr957301qkl.47.1704739225485; Mon, 08 Jan 2024 10:40:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704739225; cv=none; d=google.com; s=arc-20160816; b=sHjNM8rM19YUmf9ndHWWMz5eyW+Ax1EgPrgEomQVSETRmA/fLUdNKcRtkr1AIwRO3X 4cK8rXL46A9poepf/McxjAbE2FuEclQHF9n1fg5Frr7wU7MSpO5M7OzLQEMyEia6WYiz ZiTtB67HBoqMJwkkQDMaQcExL2A8aN8uJIiEMU3EGtNGucFPi10fNA/0hBbaM6qdt0jx 0pdclsfBxO6zYtpDNQWlvsv0WpKk98x4IE8sv4YrlnuJ9UoiHqIWiSy8n/AXX8GYn4T0 Uq6NyOKKNBEQYnBRnMbIupk22CeV/kggtSu1ycg7geK6Gbbkt3HHcOSg9eCrz+oDuSBi qhCQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=xUma43kwZXZ3kaXxzh75NrAnJAEsoLfFHHwqL86ZjQ0=; fh=3AqDzvZy8BuFcn015+g5AB3sGQnZc/edyFwniXfpO+U=; b=RJM6oxIX8s8N9Q8fC38Q65WynZBbR0MRYYFRuI0NcHQaAwCm/lK65JnnI/xvWOk1kU H0BKkhLQICgQyCtXSNPrL77k06L32B7EhqQTyveOdJhVnnGBchFkBI5rlu3kr1c85MWs Us3xbAHNY8Uzrem6w8wBMB28uVa/RMZE39eJbVUgPMLY0h9GyQEr1cMOFyKIszZZQook SbJjjKIQlm4m7g+/wS7FceuaAKkgLXjw7pUArO2ikJ2/7yrlTX5uVcxDnSO75r+62L/s GrTUBMH2ouCItXzbure16gqnNZAF5BscuRT6bKaN7QgUhzYOfA//vQHe2xADp24dcYzW W+Jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19981-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vv13-20020a05620a562d00b0078324e30241si275677qkn.149.2024.01.08.10.40.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 10:40:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-19981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19981-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3FD911C21CE4 for ; Mon, 8 Jan 2024 18:40:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAC9155776; Mon, 8 Jan 2024 18:39:57 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1674C54FB5; Mon, 8 Jan 2024 18:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=v0yd.nl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=v0yd.nl Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4T82sr74KQz9sss; Mon, 8 Jan 2024 19:39:44 +0100 (CET) From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 1/4] Bluetooth: Remove superfluous call to hci_conn_check_pending() Date: Mon, 8 Jan 2024 19:39:33 +0100 Message-ID: <20240108183938.468426-2-verdre@v0yd.nl> In-Reply-To: <20240108183938.468426-1-verdre@v0yd.nl> References: <20240108183938.468426-1-verdre@v0yd.nl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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 31ca320ce..13396329f 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3538,8 +3538,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