From mboxrd@z Thu Jan 1 00:00:00 1970 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 9E2622253F2; Mon, 18 Aug 2025 13:21:20 +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=1755523280; cv=none; b=OTux4TqHBfwt+AAUCOOsU0rZ5SXB6Kjq2Fbw7r9XxEIIPDJGwvMpnMYZ9AlLFLF8mq1iDbzScADbSsGVwIv4p3DGfBeHOt11FBX7arPSBhoAPTvvtmiDKlOy7Rf250T7+w6IuWmDtL6Rw8dfc8BkG8DGSSodXt6h01JA7auO6Z4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755523280; c=relaxed/simple; bh=tJMcw8U90GzYlPEye22Uc+IbrZSvf4ytu6CGUDuYBH4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ruiLxKbhCPcGklM0AmmWRorE2jSsbNbhgXg57e0uG3MQV+pmMHPokNm5OwsSCSANvcE6V6ZGLM/zhPPi6nznINKumpGDoTmBkmYGpoFpmoR+xYpc9gC+mBjYCDEk4oaqEkLeTK7i596+puH0fORZHF6mJG9sb2H9BQUsheTFcGI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=r3mcMFDC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="r3mcMFDC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4844EC4CEEB; Mon, 18 Aug 2025 13:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755523280; bh=tJMcw8U90GzYlPEye22Uc+IbrZSvf4ytu6CGUDuYBH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r3mcMFDChj0BULSul6REo5BL16XH7m8H+y47ty9wvYLb8X1wuXnylcV4cZVnn3G4/ yjWPLu1VS4+aa2Em076u1I5q6Ns+0dWUEn3tOgEfSlMyNWgq9yrvDzf4e7sP1qz2JB YjxdZ2XTWWK8VKUMIIfeInAMMdGIX3ys09Cd23Dw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Rafael J. Wysocki" , Prashant Malani , Viresh Kumar , Sasha Levin Subject: [PATCH 6.15 115/515] cpufreq: CPPC: Mark driver with NEED_UPDATE_LIMITS flag Date: Mon, 18 Aug 2025 14:41:41 +0200 Message-ID: <20250818124502.780137208@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124458.334548733@linuxfoundation.org> References: <20250818124458.334548733@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Prashant Malani [ Upstream commit 0a1416a49e63c320f6e6c1c8d07e1b58c0d4a3f3 ] AMU counters on certain CPPC-based platforms tend to yield inaccurate delivered performance measurements on systems that are idle/mostly idle. This results in an inaccurate frequency being stored by cpufreq in its policy structure when the CPU is brought online. [1] Consequently, if the userspace governor tries to set the frequency to a new value, there is a possibility that it would be the erroneous value stored earlier. In such a scenario, cpufreq would assume that the requested frequency has already been set and return early, resulting in the correct/new frequency request never making it to the hardware. Since the operating frequency is liable to this sort of inconsistency, mark the CPPC driver with CPUFREQ_NEED_UPDATE_LIMITS so that it is always invoked when a target frequency update is requested. Link: https://lore.kernel.org/linux-pm/20250619000925.415528-3-pmalani@google.com/ [1] Suggested-by: Rafael J. Wysocki Signed-off-by: Prashant Malani Acked-by: Viresh Kumar Link: https://patch.msgid.link/20250722055611.130574-2-pmalani@google.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/cpufreq/cppc_cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index cb93f00bafdb..156c1e516cc8 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -816,7 +816,7 @@ static struct freq_attr *cppc_cpufreq_attr[] = { }; static struct cpufreq_driver cppc_cpufreq_driver = { - .flags = CPUFREQ_CONST_LOOPS, + .flags = CPUFREQ_CONST_LOOPS | CPUFREQ_NEED_UPDATE_LIMITS, .verify = cppc_verify_policy, .target = cppc_cpufreq_set_target, .get = cppc_cpufreq_get_rate, -- 2.39.5