Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8074433rdb; Thu, 4 Jan 2024 18:56:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEl4hvrJPn+9HZrIZ8KTjScK048IMWGWostwHH9eOpTDrzsO+1Mvnqwk8iKC5q+W3XFsW/9 X-Received: by 2002:a17:906:d0ca:b0:a25:c27:11c6 with SMTP id bq10-20020a170906d0ca00b00a250c2711c6mr808791ejb.131.1704423413528; Thu, 04 Jan 2024 18:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704423413; cv=none; d=google.com; s=arc-20160816; b=gmp70/YPMrW+txANKC/CB3HHMtk/6MzrTZXCWPVDAGn4E3cEtZ2C1UTkZ9xi+yWXAU GPa5mvv0nxgOMq5vPT5c9qkOa35zPtGXeQbkEVV24D3ycmOTcZENNEuhPciNnse/ayH+ V7H+vAHIFvhUyZ4x0VqYgaxJ875wP9rfVnzvvPab+HZv13AYaPlIGzRDkhziZ+DMVfuR ONsEHGFE1udIX3011y9ktbvChkg0HfiDlGcYU/+bsmxn8JJEEgS3IC24iqZnZMnZR3fb fIksWlPrQAmuJmW3JicN486C06PFxavp85oto6mOR1wQsmDOM7b8cEIGLj8XS9dIs98A d9uw== 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:cc:to :from:dkim-signature; bh=R3eE9rNt+y7Qg78dWmtNHFDBWNey1yaJMNeWausqG00=; fh=ItjTqY7FYy7/v+cmxJZUTMi+gg9TteCkFbdek57nt7E=; b=J4+9vFGCO7cbR75lDPfla68cZQHK7MLwrqJ8N+/4HmCEm9JCjhFt2AMJS4l/+PaqAs tYwa1ClNEiEscK8cpzxvM7gJnEjuXijPzFfjNbzBpxxVMqvBCvcFKqz8yFlvbiCDJtwa R0sbvTk1IZInMaoZmiOp9y1LMxlwFLQbbpxIbjw2YscgXG/6lyOEA3NgD5qAKArIrUpM nJvzZ70besYH9rnBWb5ITPc3Z+wMgE+/lMPzXdx4lqP/fdj2JMwik12yuZEQT7BDIB4B 9l88o6wqsXga8ZEUSNS/6wSk2RoCdcf3chBzEcXhzGM5Z1MYe9Etqyr8o//CMQufjtch DhPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jvpN7Cfe; spf=pass (google.com: domain of linux-bluetooth+bounces-902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c15-20020a170906d18f00b00a2333846e72si233188ejz.739.2024.01.04.18.56.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 18:56:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=jvpN7Cfe; spf=pass (google.com: domain of linux-bluetooth+bounces-902-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-902-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 366021F22E53 for ; Fri, 5 Jan 2024 02:56:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 265FC440E; Fri, 5 Jan 2024 02:56:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="jvpN7Cfe" X-Original-To: linux-bluetooth@vger.kernel.org Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.215]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECBA42113; Fri, 5 Jan 2024 02:56:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=R3eE9 rNt+y7Qg78dWmtNHFDBWNey1yaJMNeWausqG00=; b=jvpN7CfeZD+lnKHO7rNZd R6lNIwMz4SCzoaCSnEXyxAFEFQrGmZGiUNDe18LggjkE8DC0N+e9K3Us+BMp2ec2 XfvgRmdc/srZwwnKUAeWaJabE8vXugwWfhL1Nvgzmh47Y63w4eSdU/KPzIuAzaoR u2jUW1OzjzLu53uLBVkfz0= Received: from WH-D-007635B.QUECTEL.COM (unknown [223.76.229.213]) by zwqz-smtp-mta-g5-0 (Coremail) with SMTP id _____wD3P+bbb5dl+sU1AQ--.18223S2; Fri, 05 Jan 2024 10:56:27 +0800 (CST) From: clancy_shang@163.com To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, zhongjun.yu@quectel.com, Clancy Shang Subject: [PATCH] Bluetooth: hci_sync: Fix BLE devices were unable to disable the wakeup function Date: Fri, 5 Jan 2024 10:56:25 +0800 Message-Id: <20240105025625.125895-1-clancy_shang@163.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:_____wD3P+bbb5dl+sU1AQ--.18223S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uF17Cw4DKr45CF4DWF1Dtrb_yoW8Jw4fp3 yY93ZaqF4DJr1Sk347ta18GF95CF4kWrW7KFW0kr4Y9anIqr48Aa1DCryaqa15ArZ5uF43 ZF10qF95Cry5GrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jRYL9UUUUU= X-CM-SenderInfo: xfod0ux1bvxtlqj6il2tof0z/1tbisB1cuGV4HNfAnwAAsA From: Clancy Shang when BLE master enter suspend, it does not delete the peripheral that in acceptlist. so if disable the wakeup function, the BLE master scans with basic filter next time, the peripheral can be scanned which is unexpected Signed-off-by: Clancy Shang --- net/bluetooth/hci_sync.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index d85a7091a116..abc7f614da5f 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -2533,6 +2533,7 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev) struct bdaddr_list *b, *t; u8 num_entries = 0; bool pend_conn, pend_report; + struct hci_conn_params *conn_params; u8 filter_policy; size_t i, n; int err; @@ -2585,6 +2586,15 @@ static u8 hci_update_accept_list_sync(struct hci_dev *hdev) continue; } + conn_params = hci_conn_params_lookup(hdev, &b->bdaddr, b->bdaddr_type); + /* During suspend, only wakeable devices can be in acceptlist */ + if (conn_params && hdev->suspended && + !(conn_params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) { + hci_le_del_accept_list_sync(hdev, &b->bdaddr, + b->bdaddr_type); + continue; + } + num_entries++; } -- 2.25.1