summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2026-10-05 21:13:54 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-10-14 14:38:20 -0400
commit8a8d51eeedebfa5aaaae7720f2fb2aa1a67b8587 (patch)
tree5bd69853a7bc8f1b1d858c6afb73e73b801410ab
parentcfa67a1dbfd9425044f6eef037a114b2d108f436 (diff)
downloadlinux-next-8a8d51eeedebfa5aaaae7720f2fb2aa1a67b8587.tar.gz
linux-next-8a8d51eeedebfa5aaaae7720f2fb2aa1a67b8587.zip
Bluetooth: hci_sync: fix mesh adv timeout units
Mesh adv instance timeout and duration are in milliseconds, see mesh_send_sync, hci_add_adv_instance. hci_schedule_adv_instance_sync() and hci_enable_ext_advertising_sync() ignore this, and scale the timeout wrong. Fix for mesh instances by using msecs_to_jiffies() in hci_schedule_adv_instance_sync and fixing the scaling in hci_enable_ext_advertising_sync. Fixes BlueZ "Mesh - Send cancel" test failures. Fixes: b338d91703fa ("Bluetooth: Implement support for Mesh") Assisted-by: opencode:qwen3.8-flash-next sashiko Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
-rw-r--r--net/bluetooth/hci_sync.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 6854449a060d..69ebdff2047d 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1672,7 +1672,8 @@ int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance)
* scheduling it.
*/
if (adv && adv->timeout) {
- u16 duration = adv->timeout * MSEC_PER_SEC;
+ u16 duration = adv->mesh ? adv->timeout :
+ adv->timeout * MSEC_PER_SEC;
/* Time = N * 10 ms */
set->duration = cpu_to_le16(duration / 10);
@@ -2103,7 +2104,8 @@ int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance,
hdev->adv_instance_timeout = timeout;
queue_delayed_work(hdev->req_workqueue,
&hdev->adv_instance_expire,
- secs_to_jiffies(timeout));
+ adv->mesh ? msecs_to_jiffies(timeout) :
+ secs_to_jiffies(timeout));
}
/* If we're just re-scheduling the same instance again then do not