Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp24352rdb; Mon, 22 Jan 2024 10:40:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHvym9IDbjTJpmLmVa2e5GVh8lJQWbcNmhNBARDlrRQyLynVZDKpaj93hxG2m0YTB8EmMxk X-Received: by 2002:a62:5e82:0:b0:6db:c5db:7711 with SMTP id s124-20020a625e82000000b006dbc5db7711mr1780732pfb.26.1705948818687; Mon, 22 Jan 2024 10:40:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705948818; cv=pass; d=google.com; s=arc-20160816; b=lK05f32BWAClCJMbX/ddommcL686cyxGi3CKkkoI7Pb4Rdwa5RDr6Fxm8yVxh9/IUK esBuivM/4LkNLhiulLL6xMFxNvXaDYRBABbt9idclWDccUPpFfP7cA52wMcgfJ87dekK 5YI2E87Q2CEFam7Id3o5gfbaVGx1d8X67SNovbrmopBYSorP8cTimTzavm4MNvFwDbWp vjkWehDy2yYru2Px6Fhdd0tEWztD4L3uu5T9PauNwMp7yR5SdalgDPSYeNY+5JRKPClq RUFye1A8QnfSiv29YjEQTmJ64mHmoYNGT5IUSZ78u95ZK72JB0552mc8H0ieE3RcWzCC 994Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=4ojvYmvbjtNFBD8vSWN+quTGlDupWWo9dINMv0BOrvQ=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=kf5IW+r3SGg/mmLHnsw4X8+fkp1fR8VV0RDNz+/5vcIYgvi5Kb0caX50aYd5OiPS7s /UQ8e5+8f6NtTVJl1UgemMWzMlsWCz+tQfjSihxwyNxAsFicxTyBTrjWtgXEnMp/Ra0t sHFbHwI3s2pEwKhrIknmXa4uGzN94rOQzZfX2VlmrXl2TPX0Tpq1skZNizA4Mh+jkXH5 qRmBGtktgLPDL6NyEOO6TsfrtxAVjoAXTQzNcE1FGVoBSDWXVviIRcOUqJvhZBq6NYKS uIfhdnox+jhzoaHrADuh2RomhJQtKPPaUcEzplqufFVaEHMAmO20k0rzWDnGmQLAH+Vu snXA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=NikZVnOW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y16-20020a63e250000000b005c279da45f1si8590831pgj.566.2024.01.22.10.40.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 10:40:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=NikZVnOW; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1234-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id BA28DB27BC9 for ; Mon, 22 Jan 2024 17:42:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D32E4779D; Mon, 22 Jan 2024 17:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="NikZVnOW" X-Original-To: linux-bluetooth@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C95D47793 for ; Mon, 22 Jan 2024 17:00:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705942803; cv=none; b=BB2RSL94nNLK2jMQFqc/JfUSOJ6e4J65R6E8WBLiPmEiDLbh6yl7lGSoJ1rUIFPQKDrnr0YzZKGjgW6pnwWDYHq+qF2/wl8x0ksFgshOBRgT2y0GU1Luxm2bPagqCiWu2L3oIAz3SsGUs0x0EDridvWuzrzuy/d29QUCwNxYkTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705942803; c=relaxed/simple; bh=dY53ZZwQTdfTQidnD2oMQ+8X7hoCp/XDODJmfrxRaxM=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Type; b=gD7dS7YAhRxKhPz1KYMPlX1QyT76xp0nAXRkW1HCvSVZ3RRppZY/hh1Q8vy9nz6rkzWwxZeY1bDQtEYgPPS4GYikvwydj5UxYx2lN+Zc3WMUBPRrazV2PAYc69HXUTUsZ/dXW8hyy7O1UUyQUtec0n/YL4dX+d2hY1YTPpmQx4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=NikZVnOW; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705942800; bh=dY53ZZwQTdfTQidnD2oMQ+8X7hoCp/XDODJmfrxRaxM=; h=From:To:Subject:Date:From; b=NikZVnOWY/y9a52q3siIuOtHOo5Qrc5gY7sCpJR6ZFCWPQ85SXql73HI4Jvkwfu9z k/YOQvh/ImLlEi3gXwSZa2N1tja/zDHexz0W74MeArCQVrroDerut0tu/r5iX3aaO5 e8DfGchSLTe/1ZsSr/U771psIRJymYXmhcQiSRKO7sdb+drKiIW0OkNBSNZJhb6p+/ vrtce3XI1KiIAgqB5tp7mvB8/25KYYhl7a/Illp2vbeNUAi3et2joUVcYVT6KjJDAp eD85QXF5H3mwiGKKHubUUzXpIHrPDKMm4vOd7RxfzukV2eUlADkfY5BGai1dVBN/7k rO6MCfChZSd+Q== Received: from fdanis-XPS-13-9370.. (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: fdanis) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 919E937813B5 for ; Mon, 22 Jan 2024 17:00:00 +0000 (UTC) From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= To: linux-bluetooth@vger.kernel.org Subject: [PATCH] Bluetooth: mgmt: Fix limited discoverable off timeout Date: Mon, 22 Jan 2024 17:59:55 +0100 Message-Id: <20240122165955.280126-1-frederic.danis@collabora.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit LIMITED_DISCOVERABLE flag is not reset from Class of Device and advertisement on limited discoverable timeout. This prevents to pass PTS test GAP/DISC/LIMM/BV-02-C Calling set_discoverable_sync as when the limited discovery is set correctly update the Class of Device and advertisement. Signed-off-by: Frédéric Danis --- net/bluetooth/mgmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 173986f3405f..8c4493255f92 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1045,6 +1045,8 @@ static void rpa_expired(struct work_struct *work) hci_cmd_sync_queue(hdev, rpa_expired_sync, NULL, NULL); } +static int set_discoverable_sync(struct hci_dev *hdev, void *data); + static void discov_off(struct work_struct *work) { struct hci_dev *hdev = container_of(work, struct hci_dev, @@ -1063,7 +1065,7 @@ static void discov_off(struct work_struct *work) hci_dev_clear_flag(hdev, HCI_DISCOVERABLE); hdev->discov_timeout = 0; - hci_update_discoverable(hdev); + hci_cmd_sync_queue(hdev, set_discoverable_sync, NULL, NULL); mgmt_new_settings(hdev); -- 2.34.1