Skip to contentSkip to conversation

Bluetooth: hci_sync: Fix accept_list when attempting to suspend

PATCH Applied Luiz Augusto von Dentz 3 participants 3 messages Jan 5, 2024 – Jan 8, 2024

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: hci_sync: Fix accept_list when attempting to suspend

From: Luiz Augusto von Dentz <[email protected]>

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")
---
 net/bluetooth/hci_sync.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/bluetooth/hci_sync.c +4 -1
index b3141e3f9cf6..5716345a26df 100644
@@ -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, &params->addr,
+					    params->addr_type);
 		return 0;
+	}
 
 	/* Select filter policy to accept all advertising */
 	if (*num_entries >= hdev->le_accept_list_size)
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

Dear Luiz,

Thank you for your patch.

Am 05.01.24 um 17:10 schrieb Luiz Augusto von Dentz:

Quoted 4 lines

From: Luiz Augusto von Dentz <[email protected]>

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

… the *device* can?

Quoted 16 lines

up waking up the system prematurely.

Fixes 3b42055388c3 ("Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan")
---
  net/bluetooth/hci_sync.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
net/bluetooth/hci_sync.c +0 -0
index b3141e3f9cf6..5716345a26df 100644
@@ -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 */

net/bluetooth/hci_sync.c static int hci_le_add_accept_list_sync(struct hci_dev *hdev, · line 2216

Quoted 10 lines
net/bluetooth/hci_sync.c +4 -1
  	if (hdev->suspended &&
-	    !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP))
+	    !(params->flags & HCI_CONN_FLAG_REMOTE_WAKEUP)) {
+		hci_le_del_accept_list_sync(hdev, &params->addr,
+					    params->addr_type);
  		return 0;
+	}
 
  	/* Select filter policy to accept all advertising */
  	if (*num_entries >= hdev->le_accept_list_size)

Kind regards,

Paul

#2 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 11 lines · On Fri, 5 Jan 2024 11:10:42 -0500 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

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")

[...]

Here is the summary with links:
- [v1] Bluetooth: hci_sync: Fix accept_list when attempting to suspend

    https://git.kernel.org/bluetooth/bluetooth-next/c/0bcd317e8b31

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html