Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2556117lqp; Mon, 25 Mar 2024 02:28:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlzzO9Fjs7rtEjWJFAzb4LndaacUiumwbSfwTIbPkkW6m2gT74AznTocn0wxKMxpXp/XcrIiKolkY2/bSUeSbuUOPGOg1BBbyDzWvE7g== X-Google-Smtp-Source: AGHT+IFabdBaf49JAZOxQnHy3zulEmZ6yh3JxbsskFhe2W3VDaApc5kntlEaj1PK7YWOTLRB+AkQ X-Received: by 2002:a50:9982:0:b0:566:ab90:1073 with SMTP id m2-20020a509982000000b00566ab901073mr4193078edb.34.1711358903867; Mon, 25 Mar 2024 02:28:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358903; cv=pass; d=google.com; s=arc-20160816; b=kg5KBxjwoOS7P3ZyoSUOew50gNqOyVXHUwFWV1e8ii9OZoiGDBRBfg2sgJeduCqo+I 7ARkwa1u8zwK8CRi/VVYAd1VdoMJRBWpc6jBLeMUKV/WoOelXT86L+jgp3Pi3tDSOw0s XwrOu6ZYNw4Qzn7eDZmjqKrsh7Hdjr5X6Psf0e0g0Md9zZgcXP6bJbVCUyYnmT84oVTD T+aWzjIuFwTgTveb79++Ie4eB0DEK7i+ha/uwsdubw6ZdMkDkl+Gbv2JTusNYdKrgBkM u1I+Kf/ERqa4GdBrxwXFhVGiSXCN90dTEqb62L99yIyf8j2t1+1MCZHFNe8blrPkBf5t 2E0w== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BSl4kSR+X9BajJVpD1J9pkwoooM7jRWHA4IhCA1vHaw=; fh=jbSM4RcfhLTj6HFlhNVAotJAMIdVgRP3QwTB0KHxrP8=; b=LuCvnKKry/dCXp1R3i8tfyr7GE+90WUI3bg1tjZdQ57NjvRVDhYT6uDmVPWq/P66GJ BAKSzFsMf+q+OWNhm9a83X+CTNZJITTY9sqLYB48QIYX8PY9x+s/zwHRTWtry8ruosuP 8zZMFGR6UyQn0mu/Ufgj18AWgZRSs9u/kICmsD4f2bjCoWXQZWlfTEFRMAJGNhQShMZ3 BanOYKpcKdegc7d8CNSuANqONstdBnqBNAAdLJ8LdPvsvD1rPvBu3LebYRvbX9or+dz6 3LqMmjlV2+ZkinuZ3SDhjpkja3wYF3d0/LM1ETYuvz+pUklFMze2AMb6TJ7cmsD9k+Ba /aPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BET6T8pv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id es18-20020a056402381200b0056bf2fe91bcsi2368075edb.106.2024.03.25.02.28.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:28:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BET6T8pv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115785-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115785-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5F7E71F34DAB for ; Mon, 25 Mar 2024 09:21:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3EF77262062; Mon, 25 Mar 2024 03:00:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BET6T8pv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 CF9C6145332; Sun, 24 Mar 2024 23:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321977; cv=none; b=KrQw6hWbhCY8z9XyptyDE9g/KO0afNt5g4JjUCEMd20Rh8/WM2BD5oIW8dDadWjGxgBPXnXAhEQMKvys2Ij0GEL22Jm6e9oGT+ryXq2CQ3pEqdgYopARHIVTmWBlmm3bQRFWZSDdZ0SqCHWA0RrJPBF7/ful2mbyj1BU5/19dhg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321977; c=relaxed/simple; bh=MumbKthU2I5zBp+rLx2CGii9NjmVEaYSOt6WCIXxHLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jZLveWBkQLvoewxxaLCCgnqDFXIf5DswSHkUIPN6aUqZy6MVDi5ct6lh/Ahrdv+2ehXD6L4nxLT3tcussPsQgxkpd3HHWVyfN1G+E11C1qnzXghlwJxXdfQfzGa4xrcNGqkUd3zXTESNhPGUAH27VXR2dwXO4S60kNLYmiKMIJI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BET6T8pv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C229C43394; Sun, 24 Mar 2024 23:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321977; bh=MumbKthU2I5zBp+rLx2CGii9NjmVEaYSOt6WCIXxHLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BET6T8pvX8Vh/aSmy9c0vwVUNZkGKEwDXEBquYKpvtxr0a/s3tfz31mRSFm+fC+Um DZRLwUBuV+DqW2HLRZ7p+na5MSy+I7zwwdCoX7EkgL63O0ymvfCeco/dwVu+fdseJq Y5+Is4ujxeln3aJP4r0pDfTp0CdPlpJKYjfu6EbERNDFrTBydaF/GjXdx41HyY9wL5 U1nTgX8sdG8osHA1MpnC83bOqVNggqBBrSq4BwFyu2lgixra/n2EZq2VQ9RLYsngq1 7HKin83m9e448cngJPwqvUEohaNTuCj237R4NpXDLLjq9l5bH/CNBf06o0KZ3QzXU8 uXELI2L2w2JGQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.1 050/451] Bluetooth: mgmt: Fix limited discoverable off timeout Date: Sun, 24 Mar 2024 19:05:26 -0400 Message-ID: <20240324231207.1351418-51-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Frédéric Danis [ Upstream commit 0bd1fb586235224048c726922db048d1bce6354a ] 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 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- 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 6d631a2e60166..ab63f807e3c80 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1039,6 +1039,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, @@ -1057,7 +1059,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.43.0