]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: Limit resolving a frequency to policy min/max
authorShivnandan Kumar <quic_kshivnan@quicinc.com>
Tue, 27 Feb 2024 09:13:51 +0000 (14:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:11:13 +0000 (15:11 +0200)
commit01e4e0b9e7cd36072fccc126f17de510fd4809b8
treef8906f26b1c005a66a76ac63246360fc1d73af80
parent800774927182f8eeea2351397f080375156fba4b
cpufreq: Limit resolving a frequency to policy min/max

[ Upstream commit d394abcb12bb1a6f309c1221fdb8e73594ecf1b4 ]

Resolving a frequency to an efficient one should not transgress
policy->max (which can be set for thermal reason) and policy->min.

Currently, there is possibility where scaling_cur_freq can exceed
scaling_max_freq when scaling_max_freq is an inefficient frequency.

Add a check to ensure that resolving a frequency will respect
policy->min/max.

Cc: All applicable <stable@vger.kernel.org>
Fixes: 1f39fa0dccff ("cpufreq: Introducing CPUFREQ_RELATION_E")
Signed-off-by: Shivnandan Kumar <quic_kshivnan@quicinc.com>
[ rjw: Whitespace adjustment, changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/cpufreq.h