* [PATCH v3] Bluetooth: hci_sync: Don't enable instance 0 on Set Connectable
@ 2026-11-23 9:25 Simon Mikuda
2026-11-23 12:06 ` [v3] " bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-23 9:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz
hci_update_connectable_sync() restarts the advertising of
hdev->cur_adv_instance whenever the Advertising setting is on or an
advertising instance exists. cur_adv_instance can be 0 while instances
exist, for example after the current instance was removed while another
one keeps advertising. On a controller with extended advertising, Set
Connectable then sets up and enables advertising set 0x00, the set of
the Advertising setting, although that setting is off.
Steps to reproduce, after a boot, on a controller with extended
advertising:
btmgmt advertising off
btmgmt connectable off
btmgmt add-adv -d 06097465737431 1
btmgmt add-adv -d 06097465737432 2
btmgmt rm-adv 2
btmgmt connectable on
btmon of the last step:
@ MGMT Command: Set Connectable (0x0007) plen 1
Connectable: Enabled (0x01)
[...]
< HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036)
Handle: 0x00
Properties: 0x0013
Connectable
Scannable
Use legacy advertising PDUs: ADV_IND
[...]
< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
Extended advertising: Enabled (0x01)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x00
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 1
Status: Success (0x00)
To fix this we will also check that cur_adv_instance is not 0, because
that indicates that no added instance is the current one: instance 0
is the one of the Advertising setting, and with that setting off there
is nothing to restart.
Fixes: de181e887ac2 ("Bluetooth: Impmlement extended adv enable")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
Changes in v3:
- The !list_empty(&hdev->adv_instances) check is kept next to the new
one. v2 dropped it: with cur_adv_instance naming an instance removed
during a peripheral connection, Set Connectable then failed with
Invalid Parameters on an extended advertising controller and enabled
advertising on a legacy one.
- Commit message: steps and trace are from a run on hardware
(RPi5 with Intel BE200), on a kernel built from bluetooth-next (7.3-rc2)
plus patches of ours that are not upstream. I test it against other devices
StreamKits (Synaptics, Realtek, NXP controllers - but kernel is not latest)
- Missing in the v2 changelog: v1 failed six mgmt-tester cases in CI,
the "Add (Ext) Advertising - Success ... (Connectable -> on/off)" ones.
v2: https://lore.kernel.org/linux-bluetooth/20261122191904.2261177-1-simon.mikuda@streamunlimited.com/
v1: https://lore.kernel.org/linux-bluetooth/20261122145428.1499940-1-simon.mikuda@streamunlimited.com/
net/bluetooth/hci_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 638589f77081..9896917c973b 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -6649,7 +6649,7 @@ int hci_update_connectable_sync(struct hci_dev *hdev)
/* Update the advertising parameters if necessary */
if (hci_dev_test_flag(hdev, HCI_ADVERTISING) ||
- !list_empty(&hdev->adv_instances)) {
+ (!list_empty(&hdev->adv_instances) && hdev->cur_adv_instance)) {
if (ext_adv_capable(hdev))
err = hci_start_ext_adv_sync(hdev,
hdev->cur_adv_instance);
base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [v3] Bluetooth: hci_sync: Don't enable instance 0 on Set Connectable
2026-11-23 9:25 [PATCH v3] Bluetooth: hci_sync: Don't enable instance 0 on Set Connectable Simon Mikuda
@ 2026-11-23 12:06 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-23 12:06 UTC (permalink / raw)
To: linux-bluetooth, simon.mikuda
[-- Attachment #1: Type: text/plain, Size: 1606 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/1219365/
---Test result---
Test Summary:
CheckPatch PASS 0.71 seconds
VerifyFixes PASS 0.12 seconds
VerifySignedoff PASS 0.12 seconds
GitLint PASS 0.33 seconds
SubjectPrefix PASS 0.12 seconds
BuildKernel PASS 28.76 seconds
CheckAllWarning PASS 32.97 seconds
CheckSparse PASS 35.26 seconds
BuildKernel32 PASS 28.87 seconds
CheckKernelLLVM PASS 29.52 seconds
TestRunnerSetup PASS 692.84 seconds
TestRunner_l2cap-tester PASS 14.71 seconds
TestRunner_iso-tester PASS 12.91 seconds
TestRunner_bnep-tester PASS 3.00 seconds
TestRunner_mgmt-tester PASS 87.89 seconds
TestRunner_rfcomm-tester PASS 4.29 seconds
TestRunner_sco-tester PASS 5.42 seconds
TestRunner_ioctl-tester PASS 4.49 seconds
TestRunner_mesh-tester PASS 4.33 seconds
TestRunner_smp-tester PASS 4.19 seconds
TestRunner_userchan-tester PASS 3.09 seconds
TestRunner_6lowpan-tester PASS 4.28 seconds
IncrementalBuild PASS 26.30 seconds
https://github.com/bluez/bluetooth-next/pull/1202
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-23 12:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 9:25 [PATCH v3] Bluetooth: hci_sync: Don't enable instance 0 on Set Connectable Simon Mikuda
2026-11-23 12:06 ` [v3] " bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox