From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387870; b=1DvJmi8XLLg7VfAW/oXVicO0x9MhxAMwAqTV2onuiqmLXJ49IHr8JzxjI55VUnLosl/a q0stlXxBn/kFrt8p8HvT2ix8AyuPInNRryPtcBqZXJyXAGN/6IEICkDJ57IDnMWk7dkNT HToMP4hIhBW4NJfx5jaEOP9u7/78Cw50B8UdkPy0whMk0WgAAVevX3WAHT3Gy/qoWt83I 9XE2Qh67fR6gJ/a/ynnDEsSY5N23jdpiRjVtJfSopjsBhrejrSI4OBjxS+MEdp2clkc6p jkhvvbpr1Cmls/d2G1SrkUa0scoQ9l6/Ds8hf1C8DEITpZubrDVwJaLiqU2oOJZVMqg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387870; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=nTe3Y5Ks7NBrrGnQmNxUFdjzhqvzq63cDd7MgjlsRY4=; b=R56N5cMGlUBFsL1WijmqtWm+FJf6bnWWHSSzHj+LTaAfqrqtX3jsu4mykWxaxL5ANy7p 9nrqyj7P+I6i2/g+MXSHmHa5a/o8vr6o+GPVSIFxtHJaKxkZYxnEDPFbYlB71BLsRKq6E yQOcqkZsQYbEcwjwoe+EzuUl46RrPw/iWwX6rBDiYbHywW5/YyvnLdFJrEgdeaL0UWluT b6+Kz8KMUFcOvJpTvLT7Pxo/t5WxwhDKP9jSWHhJRUELGdfWavNupt50Cj+qZACmgDY1d QbOryjZ1fZ4sFxrQNjGLp5IyI9yu7tfHUETMFKfDM2UBHEbD3w6nnJRCTuqe6ptCfiw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=stnUNlaV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9DFA606A32C; Fri, 4 Dec 2026 12:37:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=stnUNlaV Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2AEC1F00897; Fri, 4 Dec 2026 12:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387870; bh=nTe3Y5Ks7NBrrGnQmNxUFdjzhqvzq63cDd7MgjlsRY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=stnUNlaVHt1kBmBp/qPh9xTxBnbCL5q9i9ooKdktBuEByCuPSd/eQpssfkw3ZnUNq r83ZsQaQdSXChjLcgX2O0UDzoVyHfhZddbluVTCG9s73NQhtASjNh+aUY3AHu2St92 8IvSHS/p42f9RFMlJnI0KFdRD8tkLlY2bIJ2VbDg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pauli Virtanen , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.1 0391/1059] Bluetooth: hci_sync: fix mesh adv timeout units Date: Fri, 4 Dec 2026 18:58:42 +0900 Message-ID: <20261204100654.438080031@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pauli Virtanen [ Upstream commit 8a8d51eeedebfa5aaaae7720f2fb2aa1a67b8587 ] 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 Signed-off-by: Luiz Augusto von Dentz [ sashal: Replaced the non-mesh secs_to_jiffies(timeout) arm with msecs_to_jiffies(timeout * 1000), since this branch lacks secs_to_jiffies(). ] Signed-off-by: Sasha Levin --- net/bluetooth/hci_sync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 2884ca241b526..7d7122c5bb43a 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -1731,7 +1731,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); @@ -2178,7 +2179,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, - msecs_to_jiffies(timeout * 1000)); + adv->mesh ? msecs_to_jiffies(timeout) : + msecs_to_jiffies(timeout * 1000)); } /* If we're just re-scheduling the same instance again then do not -- 2.53.0