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=1796384661; b=Rvqe99dCZ0jEdAr+A8hc4ZfzB0l4Egu1mxFN4Rl3OC+HQi5WrDm8Cy04H3e9Sfnk98jg SrK5+7oacVPvFUeYtz33eGQLGHrpfjnBvXDb5yinFPOPXRVsyU3hHhPg0Vzz6/IZdnYL1 h53y8jaolAb+KT0Nve5YBtfDKDvfCDsO60WNzl5bj9mGnzFkqCU2hrfZIh9gpnKn7+D+2 FeaNAKxSY0o2bmfv12nGLTXuTKg1w3yHOFtd39Vn84xjYxyfj9KsP3nUjA1+VkMCS300J IQtMswUdOkq1TGBR4RUdXsWotN5rtNjnQDQZ9EkoPS0qoXu1C9bb+E9bLy+XvUOgqEQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384661; 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=jhjV/rr0kftVZyPyuRi5J9BRDCaOPyefM8QytXyUIOs=; b=UzpYKYUD5peXxYefHb/Yy2c8QQ9aSiEBFL3vYub6NsL7a0tXnViXO2mqwGavx2+OTkc8 +7A3BT8PCfZJL+JMsLgEKIHEMlz4Zketp766i5jEOuYRUPGLCdXIlyReTdMAbAuXSzeDp r7gKVgWcNz3gqaDC1SyC/pS0z3LH+2nqg/Y3V5joTtekIyROT4trPgftCqDK9ov2pSKxN DYG5cOQkNGULFc6YpOgE1sODbpNVByCyCAjl1BuoHZ7WO0r4aBVk/GnkSzolV3kVyN/Of ef0O15RM0IkBWSPC2rKsWhWbyJx5JDeAgNoZaLJIl8oIGt2sRmARlWty3McUTFQP/1g== 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=CK4el6dK; 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 18CFA606A322; Fri, 4 Dec 2026 11:44:21 +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=CK4el6dK Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FC0F1F00897; Fri, 4 Dec 2026 11:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384661; bh=jhjV/rr0kftVZyPyuRi5J9BRDCaOPyefM8QytXyUIOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CK4el6dKc6G1faN1tOiXTqigisx2kx5RrftFeCveMoFBXaBYBuN8rcV0Ym0oXrRL0 SbfE0PFiep4D1JT6VMEE05CIdd4QsjIp58+eMyimU0Py/CZuzc61k3OmCdOs7Vsfba tiPBYVQjFHDNqx3wGnLaLhaf9h/3hP/7h2F3A6IA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christian Loehle , Pengjie Zhang , Zhongqiu Han , Sumit Gupta , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.6 0200/1167] cpufreq: Serialize global boost updates Date: Fri, 4 Dec 2026 18:53:47 +0900 Message-ID: <20261204100707.275414203@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian Loehle [ Upstream commit 3d5720dff09f3b90d9ab2a6707e4bb8d69542f4a ] Concurrent global boost sysfs writes can interleave their global flag and per-policy updates. An enabling write can set the global flag, then a disabling write can clear it and finish before the enabling write updates the policies. Both writes succeed, leaving boost enabled on the policies while the global flag is disabled. Serialize the complete global boost update, including rollback on failure, with a mutex. Fixes: 6f19efc0a1ca ("cpufreq: Add boost frequency support in core") Signed-off-by: Christian Loehle Reviewed-by: Pengjie Zhang Reviewed-by: Zhongqiu Han Reviewed-by: Sumit Gupta Link: https://patch.msgid.link/20261105215223.1263415-3-christian.loehle@arm.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 7caf975a29614..bcdeba41a5e58 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2793,12 +2793,16 @@ static int cpufreq_boost_set_sw(struct cpufreq_policy *policy, int state) return 0; } +static DEFINE_MUTEX(cpufreq_boost_mutex); + static int cpufreq_boost_trigger_state(int state) { struct cpufreq_policy *policy; unsigned long flags; int ret = 0; + guard(mutex)(&cpufreq_boost_mutex); + /* * Don't compare 'cpufreq_driver->boost_enabled' with 'state' here to * make sure all policies are in sync with global boost flag. -- 2.53.0