]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: CPPC: fix perf_to_khz/khz_to_perf conversion exception
authorliwei <liwei728@huawei.com>
Thu, 24 Oct 2024 02:29:52 +0000 (10:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:39 +0000 (02:02 +0100)
commit2a9a3a4f26fedd4de5a3f7d4dbb0452693e4d0be
treefbeb83aea8a35d41beaaf9ab5cd7851a250f6f28
parent370192e35a5c4bc9f6378c27fa028468bb75d16e
cpufreq: CPPC: fix perf_to_khz/khz_to_perf conversion exception

[ Upstream commit d93df29bdab133b85e94b3c328e7fe26a0ebd56c ]

When the nominal_freq recorded by the kernel is equal to the lowest_freq,
and the frequency adjustment operation is triggered externally, there is
a logic error in cppc_perf_to_khz()/cppc_khz_to_perf(), resulting in perf
and khz conversion errors.

Fix this by adding a branch processing logic when nominal_freq is equal
to lowest_freq.

Fixes: ec1c7ad47664 ("cpufreq: CPPC: Fix performance/frequency conversion")
Signed-off-by: liwei <liwei728@huawei.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/20241024022952.2627694-1-liwei728@huawei.com
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/cppc_acpi.c