Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp236403rdb; Fri, 5 Jan 2024 08:11:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IE33sW2FXEJ7Et9Cyg2k9svo7qLPu60e63YGzjdbEwxueozaZn8CIr+GAyqCh3BTZAqE2Q7 X-Received: by 2002:a17:902:a3cf:b0:1d4:e011:8f2a with SMTP id q15-20020a170902a3cf00b001d4e0118f2amr1957716plb.67.1704471072253; Fri, 05 Jan 2024 08:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704471072; cv=none; d=google.com; s=arc-20160816; b=ez9e+poCq9VZzxvHYufSI+Hk8EBCsuNh1jl0Q+fMle9Sfa65sbOWHJkcXX0VYG1grb 7TF9TppQWXzaiLO6b4ZRYRn/xX4P5cLduaVGvuf57RNWSeP2alpicAM9TLeF+PFKKY7+ 2FQt4mE6renk3HSUVrVvIg8ix6zEzwzMDW/pb17heEF5n3QY6F4PsLWZ46AJ8b6Jzre4 6R8yKv7dmpxiz1VKbsM6wcxRlSGAcANBDVjk/anDNMGrD+vtNJJl4SDtZa7auMeuD4kK qCN/mERbnKHJ0Rw87gU7Lsy/OyhxEgC9V+WzKXAPzxpK+cGRTXZ2Fs1bbPd/+exP5oZk B8wQ== 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=Ha5v0lNfLjntS9f1DgYX9NfXbvlCajhkqRKHWZISUUU=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=Pz3/wTuJeKIqDJSVBCKj+8xA4gZugI2lKqgjspWpnDXEbaZ6lgtnoeUJ8Hp+xqQUhZ 2OKwJ6yhKHOx8GgA8IGZFj+PGuOZ6g8K5c4H7yiUjMp/byWp02PBV53v9lZNd/GZBvxM zWYOE+td1bvt9w5g/aVJ/tspUvwC02+Q9dLa+vWl9WWhq0kK81Ne+ZrT8Pb09WiEPWPX 3/CPhLsZPqxBF9GGJUvZY18loM30Nlea682nwugor1xzEYYIqWOPzBhbU4aPsgQirCSP aVKNZaZcwQben6zTXQ3lBv0OIugezMnehyTebHG0EzLScx5/3YQRdG2UIrC/mPT8dm/Z txqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nnGiI3WB; spf=pass (google.com: domain of linux-bluetooth+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-923-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. [139.178.88.99]) by mx.google.com with ESMTPS id v18-20020a170902e8d200b001d4d7730bf9si1399600plg.42.2024.01.05.08.11.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 08:11:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nnGiI3WB; spf=pass (google.com: domain of linux-bluetooth+bounces-923-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-923-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 75157284991 for ; Fri, 5 Jan 2024 16:11:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 040E62E844; Fri, 5 Jan 2024 16:10:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nnGiI3WB" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (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 1E2F12E824 for ; Fri, 5 Jan 2024 16:10:45 +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-yw1-f171.google.com with SMTP id 00721157ae682-5edf3780534so17687967b3.0 for ; Fri, 05 Jan 2024 08:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704471044; x=1705075844; 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=Ha5v0lNfLjntS9f1DgYX9NfXbvlCajhkqRKHWZISUUU=; b=nnGiI3WBQZNSJeym+ws0L6z9lEVoSJ0YX+JkkHUdp/ycjy4GeZvw766Tm95JLggABn ewPdiD4+EOgkHGMj56EjVn6gpLZd7cOM57HGQxZpBmkGHxdRbZbs1lrH4VpMs9l/DU9z TFvWtG0zN9eVXwZRjHfK765wPtWO/SdhO2UBYtwfpk8CBtubaY2FkdpUk5TQRL6uXzfc 1QnkwOjdXiY3bZfv8iG8qnJDXoVyMiUL/VIpkEa08vg2+Zmz6x/S4fyvEC1M80Kq4iRy NO2LZ3nd5KU1fo+a22qE6sisL30k4VDDyfGdHJMBJLuJQC9yM9kl4aL8zA8tUOYqkUeH kbfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704471044; x=1705075844; 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=Ha5v0lNfLjntS9f1DgYX9NfXbvlCajhkqRKHWZISUUU=; b=RtQ7eU65gYMHEOJJSN/86WeaeNfImxuV9uKgek5e7ofGMRJHCDe4FhXDedVdY5w9T6 hxlT989ZpL02cdtmpevKlOdz0blGUSSnrP/J0D/kibkcnw+twIDO2PHyLZ9iTEYPSxii TKRYJxWSmuVrgB8goPx//8XwUfgeHPDXmxLVA/5jN3u48Bt2wP7c58MyMxNwJ6/9SyYm C0BwBnY40wA5nca/01Zbkl69hpO82MKfCcmYed6tw9JtcuC8UWnHFlkpqa61DIQ+sVvb 8UenFjPOZ0O5BU3hAlwJYIDF50JOH8yOTSz/HlsQ5bMbkYXbuxVefEcFS6a1bxY15eXp azOA== X-Gm-Message-State: AOJu0YyKIO85wlxPEyi5dRp4QyEo1/GCYLWIcQ3xJalEKAHv8c8z3TJC XGuxW8f+jkoRmhpabEtfPHMDAeOj0Q0= X-Received: by 2002:a25:c746:0:b0:dbd:ae7d:ce7c with SMTP id w67-20020a25c746000000b00dbdae7dce7cmr2245172ybe.67.1704471044295; Fri, 05 Jan 2024 08:10:44 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id f16-20020a258550000000b00d974c72068fsm500086ybn.4.2024.01.05.08.10.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 08:10:43 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v1] Bluetooth: hci_sync: Fix accept_list when attempting to suspend Date: Fri, 5 Jan 2024 11:10:42 -0500 Message-ID: <20240105161042.4179775-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-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz During suspend, only wakeable devices can be in acceptlist, so if the device was previously added it needs to be removed otherwise the can end up waking up the system prematurely. Fixes: 3b42055388c3 ("Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan") Signed-off-by: Clancy Shang Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_sync.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index b3141e3f9cf6..5716345a26df 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -2206,8 +2206,11 @@ static int hci_le_add_accept_list_sync(struct hci_dev *hdev, /* During suspend, only wakeable devices can be in acceptlist */ if (hdev->suspended && - !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) + !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) { + hci_le_del_accept_list_sync(hdev, ¶ms->addr, + params->addr_type); return 0; + } /* Select filter policy to accept all advertising */ if (*num_entries >= hdev->le_accept_list_size) -- 2.43.0