-
Notifications
You must be signed in to change notification settings - Fork 971
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Instead of reverting the new hci_sync based BLE scan disable logic use the fix proposed by Luiz: https://lore.kernel.org/linux-bluetooth/CABBYNZ+5RMqNVMyYKi+gOVaV+K6k8Z-C37KnfGa=qRUORc3dWg@mail.gmail.com/ This fix avoids BLE stalls just like the revert.
- Loading branch information
Showing
2 changed files
with
60 additions
and
221 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...ot-external/patches/linux/0001-Bluetooth-hci_sync-Fix-handling-of-HCI_QUIRK_STRICT_.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
From b93f2a3748f32cde4a09cade7948bb406a2a4091 Mon Sep 17 00:00:00 2001 | ||
Message-ID: <b93f2a3748f32cde4a09cade7948bb406a2a4091.1693428313.git.stefan@agner.ch> | ||
From: Luiz Augusto von Dentz <[email protected]> | ||
Date: Tue, 29 Aug 2023 13:59:36 -0700 | ||
Subject: [PATCH] Bluetooth: hci_sync: Fix handling of | ||
HCI_QUIRK_STRICT_DUPLICATE_FILTER | ||
|
||
When HCI_QUIRK_STRICT_DUPLICATE_FILTER is set LE scanning requires | ||
periodic restarts of the scanning procedure as the controller would | ||
consider device previously found as duplicated despite of RSSI changes, | ||
but in order to set the scan timeout properly set le_scan_restart needs | ||
to be synchronous so it shall not use hci_cmd_sync_queue which defers | ||
the command processing to cmd_sync_work. | ||
|
||
link: https://lore.kernel.org/linux-bluetooth/[email protected]/#t | ||
Fixes: 27d54b778ad1 ("Bluetooth: Rework le_scan_restart for hci_sync") | ||
Signed-off-by: Luiz Augusto von Dentz <[email protected]> | ||
--- | ||
net/bluetooth/hci_sync.c | 13 ++++--------- | ||
1 file changed, 4 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c | ||
index 2ae038dfc39f..f8bb2504f99a 100644 | ||
--- a/net/bluetooth/hci_sync.c | ||
+++ b/net/bluetooth/hci_sync.c | ||
@@ -412,11 +412,6 @@ static int hci_le_scan_restart_sync(struct hci_dev *hdev) | ||
LE_SCAN_FILTER_DUP_ENABLE); | ||
} | ||
|
||
-static int le_scan_restart_sync(struct hci_dev *hdev, void *data) | ||
-{ | ||
- return hci_le_scan_restart_sync(hdev); | ||
-} | ||
- | ||
static void le_scan_restart(struct work_struct *work) | ||
{ | ||
struct hci_dev *hdev = container_of(work, struct hci_dev, | ||
@@ -426,15 +421,15 @@ static void le_scan_restart(struct work_struct *work) | ||
|
||
bt_dev_dbg(hdev, ""); | ||
|
||
- hci_dev_lock(hdev); | ||
- | ||
- status = hci_cmd_sync_queue(hdev, le_scan_restart_sync, NULL, NULL); | ||
+ status = hci_le_scan_restart_sync(hdev); | ||
if (status) { | ||
bt_dev_err(hdev, "failed to restart LE scan: status %d", | ||
status); | ||
- goto unlock; | ||
+ return; | ||
} | ||
|
||
+ hci_dev_lock(hdev); | ||
+ | ||
if (!test_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks) || | ||
!hdev->discovery.scan_start) | ||
goto unlock; | ||
-- | ||
2.42.0 | ||
|
221 changes: 0 additions & 221 deletions
221
...ot-external/patches/linux/0001-Revert-Bluetooth-Rework-le_scan_restart-for-hci_sync.patch
This file was deleted.
Oops, something went wrong.