Message ID | 20240102185933.64179-2-verdre@v0yd.nl |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-14751-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp4629467dyb; Tue, 2 Jan 2024 11:00:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IF425rTorMXLW06s3M5vBt/pzvdWfJ5meh7PSS/U7+QOL7tCa6dJb8rwpWXYUucRKmSePPH X-Received: by 2002:a17:907:1b09:b0:a26:cdae:e295 with SMTP id mp9-20020a1709071b0900b00a26cdaee295mr19017307ejc.74.1704222029039; Tue, 02 Jan 2024 11:00:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704222029; cv=none; d=google.com; s=arc-20160816; b=DQUVjGXIPqCXiM2B4y3/RhKiYIuxPJr8HUJB+dwWG5Adp71DkqnZVm1XYay5j/NlIb NRJ7XNpk6CtkFdF0hJY1xMUYbNqQrqyO6gAY3TsUjzs6XUF8Nj4mA6u5nB744VzQ21tS quusL/SKl9pp354+VXyCx3PiQfoeeN8R6iE+ROjufyrv4uizBud1HsmnCpf2KTFdrhyD 23Axq9Dlc9Q4Sp40WVQNRXhemDNtnv1K9DDzy56mI6qKnw1Vxc5nDXK6iat/t66+uwFp ACcuY3mBprzOjQuZiDRvTZ86lmR7XhzmNRVbo/vGpqHcvJfoOGx+Fpl2wh8y+7JQgNNL 0VDg== 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=0CFKc1uU2oc55iKdjjsuGNMWD26URjsdIPjyYZJI7Zg=; fh=3AqDzvZy8BuFcn015+g5AB3sGQnZc/edyFwniXfpO+U=; b=sHn70kq8PdvWDoKkLAy6DdM11DWfVFkFHb2cgzc4FTXbgqQpfoJ/A6nc+EcS6YG8+V pIPb2zaCb8HBvUx08+adkMBx4ndtdyIQWpgYBpBXB/3kSqMrgEqhHPPIBiyR5xb7Zaaz Oiwy73gM1rQHawN2+luKDcTrSmj3US1rbriQcfB45n7c/6xC06t81rNL95LnUxSrJREb 3vVlGmhPOs63qS2OMLc96NlCW9nWGDisOW4hnD2zdW0Ov3BGH0J+/lL/+xASo/rrIvn2 auG5+tmsJ0O67QYfV7vHdJdV0T0GQQndJNXSA4hObjNA7R9epLEP50ktK019yuwJ3yg9 88cQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14751-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k22-20020a170906681600b00a188852ae17si11429269ejr.681.2024.01.02.11.00.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 11:00:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-14751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14751-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A58D91F21B06 for <ouuuleilei@gmail.com>; Tue, 2 Jan 2024 19:00:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13ABE16424; Tue, 2 Jan 2024 18:59:45 +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 88FAC15AD3; Tue, 2 Jan 2024 18:59:41 +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 smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (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 4T4MbY5VtLz9sb4; Tue, 2 Jan 2024 19:59:37 +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 1/5] Bluetooth: Remove superfluous call to hci_conn_check_pending() Date: Tue, 2 Jan 2024 19:59:28 +0100 Message-ID: <20240102185933.64179-2-verdre@v0yd.nl> In-Reply-To: <20240102185933.64179-1-verdre@v0yd.nl> References: <20240102185933.64179-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-Rspamd-Queue-Id: 4T4MbY5VtLz9sb4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787006318139076280 X-GMAIL-MSGID: 1787006318139076280 |
Series |
Bluetooth: Improve retrying of connection attempts
|
|
Commit Message
Jonas Dreßler
Jan. 2, 2024, 6:59 p.m. UTC
The "pending connections" feature was originally introduced with commit
4c67bc74f016b0d360b8573e18969c0ff7926974 and
6bd57416127e92d35e6798925502c84e14a3a966 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
89e65975fea5c25706e8cc3a89f9f97b20fc45ad.
With commit a9de9248064bfc8eb0a183a6a951a4e7b5ca10a4,
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: a9de9248064bfc8eb0a183a6a951a4e7b5ca10a4
Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
---
net/bluetooth/hci_event.c | 2 --
1 file changed, 2 deletions(-)
Comments
On Tue, Jan 02, 2024 at 07:59:28PM +0100, Jonas Dreßler wrote: > The "pending connections" feature was originally introduced with commit > 4c67bc74f016b0d360b8573e18969c0ff7926974 and > 6bd57416127e92d35e6798925502c84e14a3a966 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 > 89e65975fea5c25706e8cc3a89f9f97b20fc45ad. > > With commit a9de9248064bfc8eb0a183a6a951a4e7b5ca10a4, > 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: a9de9248064bfc8eb0a183a6a951a4e7b5ca10a4 > Signed-off-by: Jonas Dreßler <verdre@v0yd.nl> Nit: a correct format for the fixes tag is Fixes: a9de9248064b ("[Bluetooth] Switch from OGF+OCF to using only opcodes") Likewise, in the patch description, it is usual to cite patches using a similar format. e.g. introduced in commit 4c67bc74f016 ("[Bluetooth] Support concurrent connect requests") Note it is usual to use a hash of at least 12 characters (and not much more than that). ...
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);