Skip to content

Commit 521223d

Browse files
committed
cpufreq: Fix initialization of min and max frequency QoS requests
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 <[email protected]> Tested-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent b6e6f8b commit 521223d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/cpufreq.c

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

14041404
ret = freq_qos_add_request(&policy->constraints,
14051405
policy->min_freq_req, FREQ_QOS_MIN,
1406-
policy->min);
1406+
FREQ_QOS_MIN_DEFAULT_VALUE);
14071407
if (ret < 0) {
14081408
/*
14091409
* So we don't call freq_qos_remove_request() for an
@@ -1423,7 +1423,7 @@ static int cpufreq_online(unsigned int cpu)
14231423

14241424
ret = freq_qos_add_request(&policy->constraints,
14251425
policy->max_freq_req, FREQ_QOS_MAX,
1426-
policy->max);
1426+
FREQ_QOS_MAX_DEFAULT_VALUE);
14271427
if (ret < 0) {
14281428
policy->max_freq_req = NULL;
14291429
goto out_destroy_policy;

0 commit comments

Comments
 (0)