Message ID | 20240108224614.56900-2-verdre@v0yd.nl |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-20159-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1315218dyq; Mon, 8 Jan 2024 14:47:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEy4YOudC01rurruAoHfmKltVzdBW+ZZub+Nbt9ozFXcf/Fz5doskfJ7s9T3hsK9nCcff8 X-Received: by 2002:a05:6a00:1c82:b0:6d9:ac79:cbb4 with SMTP id y2-20020a056a001c8200b006d9ac79cbb4mr2224936pfw.24.1704754038837; Mon, 08 Jan 2024 14:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704754038; cv=none; d=google.com; s=arc-20160816; b=fkuMiz1vNJ+6ZNdBHJzuO2bqoNBm/4ZKqWXUBD+V2plE9uMmT7ykcc2fLkb14+Bx/B VxxD0cmIFnIAeLHlwjrxZP0Afz3IBJTJCkHx4NnH+QVCuOByr0XNf2D1T2xOJQQIrDP0 +Qce3CHbRYzLUS7jYAgPy4bZwn6Ot+31QsTLSaqdUkvzimJCIIDDfy8H7+4NL00lxNAl oJ6SvB49rBZQwfM8ArtF/KKIaii09UtfDqguIH3EgjXzGYZU0YdPOFtv5744IQCd7Er8 7I994IX5EAPEekcor/GS4ZPPEwVZc0nt2i8iG0MCdYyK6iQTB5pRQUpdSSYZeskBYcTb ixyw== 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=hiaXrR0hTYnK7/nSQcQCzl8Bu/pV1ebtyvW3Ho7vYpk=; fh=3AqDzvZy8BuFcn015+g5AB3sGQnZc/edyFwniXfpO+U=; b=b0pGEpgfbqF/XhDrWytJgoWweZUs7a73NGqW7R5um429FvHjkXXfSnwSUcxvfCltsA 2kgXZM1VYlW6xx+vf+xY6CsuizAwNu5JuckAj4k/7U/tvS8+dVSloOHE7XCxSJVki05Q CRcnVQUhb9oe9Ob/uj36bXhTVfxy1fVXy4aet9txrfMF+tYh+wgJRRCAoVAOLS5HJi3R kNFgXaRR2b4SMs3u4U22JOTzQhQN2wsuK+tkQGFg7R7x5G0TKkmK6V23pFdrXvWyTNVu Ct8s38r8uuHGU/z0XdO/kR0M0pcOR4B03xCWkCMhuS0mLxsW/FOF08484cv9XleZ2XXw 3IBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20159-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20159-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y12-20020aa79e0c000000b006dad16336f3si484260pfq.5.2024.01.08.14.47.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 14:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20159-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20159-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20159-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 99378284F21 for <ouuuleilei@gmail.com>; Mon, 8 Jan 2024 22:47:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0BBE56779; Mon, 8 Jan 2024 22:46:32 +0000 (UTC) Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (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 13EF026AE1; Mon, 8 Jan 2024 22:46:28 +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 smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (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-101.mailbox.org (Postfix) with ESMTPS id 4T88LT3FHvz9sbL; Mon, 8 Jan 2024 23:46:25 +0100 (CET) From: =?utf-8?q?Jonas_Dre=C3=9Fler?= <verdre@v0yd.nl> To: Marcel Holtmann <marcel@holtmann.org>, Johan Hedberg <johan.hedberg@gmail.com>, Luiz Augusto von Dentz <luiz.dentz@gmail.com> Cc: =?utf-8?q?Jonas_Dre=C3=9Fler?= <verdre@v0yd.nl>, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v3 1/4] Bluetooth: Remove superfluous call to hci_conn_check_pending() Date: Mon, 8 Jan 2024 23:46:06 +0100 Message-ID: <20240108224614.56900-2-verdre@v0yd.nl> In-Reply-To: <20240108224614.56900-1-verdre@v0yd.nl> References: <20240108224614.56900-1-verdre@v0yd.nl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787564171085852302 X-GMAIL-MSGID: 1787564171085852302 |
Series |
Bluetooth: Improve retrying of connection attempts
|
|
Commit Message
Jonas Dreßler
Jan. 8, 2024, 10:46 p.m. UTC
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 <verdre@v0yd.nl>
---
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 1e1c91473..9423394f6 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3547,8 +3547,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);