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=1796387310; b=MqyKEGIWX1Rkomw3qjE5jLs/18QV3Vd6yMfM8qWX68TcuxApIFlcAGdS9c6tzH1DZWkC Ictgmi4quNB2E0g3gOcGdB45DohDDUnhihmF8Bs379vifaLFjO3khmXpn5bKmH8I9zB6x OKv+OK01q1R/6qYGnAumIN9JjgLRWHrKxdiQExQpgugOq9ixElQ82GHGkCNY6EFWbFHzu IhAU4e3S2RuwJSqgamkEfOf8sxtIxVBQDee7jOfh5bPzQCZA2fWm5TdWlb6TiraYK3EUV CXF0RfgxO/idXF+btTaYm33xYmhO8qZ1ndr88yOtevcB+9hRgEvolJYxqBC6kwOHvQA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387310; 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=MBdK588sSY7iEcbeevTSDMU59mVpipySGmtBVWYNdr4=; b=4hhY8OYyMOzGizFbpAXv9iavyw3Zgp5VSKI7O2/uu+SYcAuHkjl/zqLXtFRtuXYlTEWV A8zDAiKbJHkZp/RQQOUPJrifwyP+4eEZE+4wt2tzb+N7uGI48izHfaMdKVHPpgESQLb2h q/sjKBjTXCRA7llLRhJEe5pVEcqidPhDeY1k4+r/2kDxj/a9fmed4v8c5+Vn4AfDKDv5p nBZRdDpmaG5IKiGsa09EcRu1xMXFSgvD6VkZpuqgH5eprxENryzVTl2LrePbayIf1TQ9H v/EQM7mprvcuiT5ALPVDaPRBHAZL6mlwsHsTyzbhsX8FhTOztkBhapy5gfLJCwFnm4w== 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=d0ZEnOUC; 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 52B35606A32C; Fri, 4 Dec 2026 12:28:30 +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=d0ZEnOUC Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF9E31F00A05; Fri, 4 Dec 2026 12:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387310; bh=MBdK588sSY7iEcbeevTSDMU59mVpipySGmtBVWYNdr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=d0ZEnOUC0Z4RV+gMvyfnVRuYyMlmMZ+2cqrwzo8aEpZ3VRWlUULJzmTFmWTssLMUO 3Y2NOPhFK6DfH/2zyX6e23GkjybFe/EUz3qn4B90uCaLFcnpaIxaCMbjZiqsMo3/UD fJmgHZ4FoX5Lcno0hOCRpT4mBt1BtrkNliQ2qJ/4= 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.1 0152/1059] cpufreq: Serialize global boost updates Date: Fri, 4 Dec 2026 18:54:43 +0900 Message-ID: <20261204100648.155359377@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: stable@vger.kernel.org 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: 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(+) --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2740,6 +2740,8 @@ static int cpufreq_boost_set_sw(struct c return 0; } +static DEFINE_MUTEX(cpufreq_boost_mutex); + int cpufreq_boost_trigger_state(int state) { struct cpufreq_policy *policy; @@ -2747,6 +2749,8 @@ int cpufreq_boost_trigger_state(int stat bool boost_enabled; int ret = -EOPNOTSUPP; + 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.