Skip to content

Commit 282286c

Browse files
rafaeljwgregkh
authored andcommitted
cpufreq: Fix initialization of min and max frequency QoS requests
[ Upstream commit 521223d ] The min and max frequency QoS requests in the cpufreq core are initialized to whatever the current min and max frequency values are at the init time, but if any of these values change later (for example, cpuinfo.max_freq is updated by the driver), these initial request values will be limiting the CPU frequency unnecessarily unless they are changed by user space via sysfs. To address this, initialize min_freq_req and max_freq_req to FREQ_QOS_MIN_DEFAULT_VALUE and FREQ_QOS_MAX_DEFAULT_VALUE, respectively, so they don't really limit anything until user space updates them. Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 37b25de commit 282286c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/cpufreq/cpufreq.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ static int cpufreq_online(unsigned int cpu)
14001400

14011401
ret = freq_qos_add_request(&policy->constraints,
14021402
policy->min_freq_req, FREQ_QOS_MIN,
1403-
policy->min);
1403+
FREQ_QOS_MIN_DEFAULT_VALUE);
14041404
if (ret < 0) {
14051405
/*
14061406
* So we don't call freq_qos_remove_request() for an
@@ -1420,7 +1420,7 @@ static int cpufreq_online(unsigned int cpu)
14201420

14211421
ret = freq_qos_add_request(&policy->constraints,
14221422
policy->max_freq_req, FREQ_QOS_MAX,
1423-
policy->max);
1423+
FREQ_QOS_MAX_DEFAULT_VALUE);
14241424
if (ret < 0) {
14251425
policy->max_freq_req = NULL;
14261426
goto out_destroy_policy;

0 commit comments

Comments
 (0)