All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_sync: Don't filter duplicates while a PA sync is pending
@ 2026-11-22 20:13 Simon Mikuda
  2026-11-22 22:47 ` bluez.test.bot
  2026-11-23 14:18 ` [PATCH] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Mikuda @ 2026-11-22 20:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz

To sync to a broadcast, the controller needs an extended advertisement of
the source after LE Periodic Advertising Create Sync, because that carries
the SyncInfo. Some controllers, for example an NXP one and an Intel
BE200, only use the SyncInfo of an advertisement they report to
the host. With the duplicates filter on, they report a source once per
scan. Passive scanning starts right before Create Sync, so when the source
is reported in between, its later advertisements are filtered out and the
sync waits until the host cancels it after 20 seconds:

    21:59:14.147 > LE Extended Advertising Report  50:1E:2D:9F:95:23
    21:59:14.149 < LE Periodic Advertising Create Sync
    21:59:35.131 < LE Periodic Advertising Create Sync Cancel
    21:59:35.132 > LE Periodic Advertising Sync Established
                     Status: Operation Cancelled by Host (0x44)

Turn the filter off while a PA sync is pending. The accept list limits the
reports to the source being synced.

Steps to reproduce:
1. Start a broadcast on another device.
2. Join it, leave and join again, repeatedly. Rarely the sync takes more
   than 10 seconds, and until then there is no sound.

Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/hci_sync.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 638589f77081..88ce0ceef394 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3645,6 +3645,12 @@ static int hci_passive_scan_sync(struct hci_dev *hdev)
 		filter_dups = LE_SCAN_FILTER_DUP_DISABLE;
 	}
 
+	/* The controller only syncs on a report it doesn't filter as a duplicate,
+	 * and that report can come before the sync is created.
+	 */
+	if (hci_dev_test_flag(hdev, HCI_PA_SYNC))
+		filter_dups = LE_SCAN_FILTER_DUP_DISABLE;
+
 	bt_dev_dbg(hdev, "LE passive scan with acceptlist = %d", filter_policy);
 
 	return hci_start_scan_sync(hdev, LE_SCAN_PASSIVE, interval, window,

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: Bluetooth: hci_sync: Don't filter duplicates while a PA sync is pending
  2026-11-22 20:13 [PATCH] Bluetooth: hci_sync: Don't filter duplicates while a PA sync is pending Simon Mikuda
@ 2026-11-22 22:47 ` bluez.test.bot
  2026-11-23 14:18 ` [PATCH] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2026-11-22 22:47 UTC (permalink / raw)
  To: linux-bluetooth, simon.mikuda

[-- Attachment #1: Type: text/plain, Size: 1879 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1218948/

---Test result---

Test Summary:
CheckPatch                    PASS      0.58 seconds
VerifyFixes                   PASS      0.11 seconds
VerifySignedoff               PASS      0.11 seconds
GitLint                       PASS      0.29 seconds
SubjectPrefix                 PASS      0.11 seconds
BuildKernel                   PASS      21.45 seconds
CheckAllWarning               PASS      24.62 seconds
CheckSparse                   PASS      26.05 seconds
BuildKernel32                 PASS      21.38 seconds
CheckKernelLLVM               PASS      22.03 seconds
TestRunnerSetup               PASS      497.75 seconds
TestRunner_l2cap-tester       PASS      14.24 seconds
TestRunner_iso-tester         PASS      11.88 seconds
TestRunner_bnep-tester        PASS      3.20 seconds
TestRunner_mgmt-tester        PASS      85.27 seconds
TestRunner_rfcomm-tester      PASS      4.44 seconds
TestRunner_sco-tester         PASS      5.49 seconds
TestRunner_ioctl-tester       PASS      4.54 seconds
TestRunner_mesh-tester        FAIL      3.45 seconds
TestRunner_smp-tester         PASS      4.37 seconds
TestRunner_userchan-tester    PASS      3.23 seconds
TestRunner_6lowpan-tester     PASS      4.40 seconds
IncrementalBuild              PASS      19.38 seconds

Details
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 9 (90.0%), Failed: 1, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 2                               Failed       0.023 seconds


https://github.com/bluez/bluetooth-next/pull/1193

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluetooth: hci_sync: Don't filter duplicates while a PA sync is pending
  2026-11-22 20:13 [PATCH] Bluetooth: hci_sync: Don't filter duplicates while a PA sync is pending Simon Mikuda
  2026-11-22 22:47 ` bluez.test.bot
@ 2026-11-23 14:18 ` Luiz Augusto von Dentz
  2026-11-23 15:14   ` Simon Mikuda
  1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2026-11-23 14:18 UTC (permalink / raw)
  To: Simon Mikuda; +Cc: linux-bluetooth, Marcel Holtmann

Hi Simon,

On Sun, Nov 22, 2026 at 3:13 PM Simon Mikuda
<simon.mikuda@streamunlimited.com> wrote:
>
> To sync to a broadcast, the controller needs an extended advertisement of
> the source after LE Periodic Advertising Create Sync, because that carries
> the SyncInfo. Some controllers, for example an NXP one and an Intel
> BE200, only use the SyncInfo of an advertisement they report to
> the host. With the duplicates filter on, they report a source once per
> scan. Passive scanning starts right before Create Sync, so when the source
> is reported in between, its later advertisements are filtered out and the
> sync waits until the host cancels it after 20 seconds:
>
>     21:59:14.147 > LE Extended Advertising Report  50:1E:2D:9F:95:23
>     21:59:14.149 < LE Periodic Advertising Create Sync
>     21:59:35.131 < LE Periodic Advertising Create Sync Cancel
>     21:59:35.132 > LE Periodic Advertising Sync Established
>                      Status: Operation Cancelled by Host (0x44)
>
> Turn the filter off while a PA sync is pending. The accept list limits the
> reports to the source being synced.
>
> Steps to reproduce:
> 1. Start a broadcast on another device.
> 2. Join it, leave and join again, repeatedly. Rarely the sync takes more
>    than 10 seconds, and until then there is no sound.
>
> Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
> Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
> ---
>  net/bluetooth/hci_sync.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index 638589f77081..88ce0ceef394 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -3645,6 +3645,12 @@ static int hci_passive_scan_sync(struct hci_dev *hdev)
>                 filter_dups = LE_SCAN_FILTER_DUP_DISABLE;
>         }
>
> +       /* The controller only syncs on a report it doesn't filter as a duplicate,
> +        * and that report can come before the sync is created.
> +        */
> +       if (hci_dev_test_flag(hdev, HCI_PA_SYNC))
> +               filter_dups = LE_SCAN_FILTER_DUP_DISABLE;

We should probably check if the HCI_QUIRK_STRICT_DUPLICATE_FILTER is
set though, that said hci_le_past_params_sync may have a similar
problem wrt to mode but I wonder if we should really work around this
or inform the hardware/firmware does have a bug, because filtering
duplicates shouldn't mean treat as they never happened just don't send
them to host otherwise while attempting to synchronize a BIG we maybe
flooded with PA reports that have no use for the host.

>         bt_dev_dbg(hdev, "LE passive scan with acceptlist = %d", filter_policy);
>
>         return hci_start_scan_sync(hdev, LE_SCAN_PASSIVE, interval, window,
>
> base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
> --
> 2.43.0
>


-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluetooth: hci_sync: Don't filter duplicates while a PA sync is pending
  2026-11-23 14:18 ` [PATCH] " Luiz Augusto von Dentz
@ 2026-11-23 15:14   ` Simon Mikuda
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Mikuda @ 2026-11-23 15:14 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth, Marcel Holtmann

Hi Luiz.

You are right this is controller bug. We will try to report it to chip 
vendors and
see what they will reply. From now we will keep this as a HACK for 
broken chips.

We do not set HCI_QUIRK_STRICT_DUPLICATE_FILTER on our hw that we use.

Thanks for your support and pointers!

BR,
Simon

On 11/23/26 15:18, Luiz Augusto von Dentz wrote:
> Hi Simon,
>
> On Sun, Nov 22, 2026 at 3:13 PM Simon Mikuda
> <simon.mikuda@streamunlimited.com> wrote:
>> To sync to a broadcast, the controller needs an extended advertisement of
>> the source after LE Periodic Advertising Create Sync, because that carries
>> the SyncInfo. Some controllers, for example an NXP one and an Intel
>> BE200, only use the SyncInfo of an advertisement they report to
>> the host. With the duplicates filter on, they report a source once per
>> scan. Passive scanning starts right before Create Sync, so when the source
>> is reported in between, its later advertisements are filtered out and the
>> sync waits until the host cancels it after 20 seconds:
>>
>>      21:59:14.147 > LE Extended Advertising Report  50:1E:2D:9F:95:23
>>      21:59:14.149 < LE Periodic Advertising Create Sync
>>      21:59:35.131 < LE Periodic Advertising Create Sync Cancel
>>      21:59:35.132 > LE Periodic Advertising Sync Established
>>                       Status: Operation Cancelled by Host (0x44)
>>
>> Turn the filter off while a PA sync is pending. The accept list limits the
>> reports to the source being synced.
>>
>> Steps to reproduce:
>> 1. Start a broadcast on another device.
>> 2. Join it, leave and join again, repeatedly. Rarely the sync takes more
>>     than 10 seconds, and until then there is no sound.
>>
>> Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
>> Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
>> ---
>>   net/bluetooth/hci_sync.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
>> index 638589f77081..88ce0ceef394 100644
>> --- a/net/bluetooth/hci_sync.c
>> +++ b/net/bluetooth/hci_sync.c
>> @@ -3645,6 +3645,12 @@ static int hci_passive_scan_sync(struct hci_dev *hdev)
>>                  filter_dups = LE_SCAN_FILTER_DUP_DISABLE;
>>          }
>>
>> +       /* The controller only syncs on a report it doesn't filter as a duplicate,
>> +        * and that report can come before the sync is created.
>> +        */
>> +       if (hci_dev_test_flag(hdev, HCI_PA_SYNC))
>> +               filter_dups = LE_SCAN_FILTER_DUP_DISABLE;
> We should probably check if the HCI_QUIRK_STRICT_DUPLICATE_FILTER is
> set though, that said hci_le_past_params_sync may have a similar
> problem wrt to mode but I wonder if we should really work around this
> or inform the hardware/firmware does have a bug, because filtering
> duplicates shouldn't mean treat as they never happened just don't send
> them to host otherwise while attempting to synchronize a BIG we maybe
> flooded with PA reports that have no use for the host.
>
>>          bt_dev_dbg(hdev, "LE passive scan with acceptlist = %d", filter_policy);
>>
>>          return hci_start_scan_sync(hdev, LE_SCAN_PASSIVE, interval, window,
>>
>> base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
>> --
>> 2.43.0
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-23 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 20:13 [PATCH] Bluetooth: hci_sync: Don't filter duplicates while a PA sync is pending Simon Mikuda
2026-11-22 22:47 ` bluez.test.bot
2026-11-23 14:18 ` [PATCH] " Luiz Augusto von Dentz
2026-11-23 15:14   ` Simon Mikuda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.