提交 425ba857 编写于 作者: R Rafael J. Wysocki 提交者: Zheng Zengkai

cpufreq: Fix initialization of min and max frequency QoS requests

stable inclusion
from stable-v5.10.94
commit 282286c632a2ae8def0f781e643c099317df4252
bugzilla: https://gitee.com/openeuler/kernel/issues/I531X9

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=282286c632a2ae8def0f781e643c099317df4252

--------------------------------

[ Upstream commit 521223d8 ]

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: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 b48b3e9a
...@@ -1400,7 +1400,7 @@ static int cpufreq_online(unsigned int cpu) ...@@ -1400,7 +1400,7 @@ static int cpufreq_online(unsigned int cpu)
ret = freq_qos_add_request(&policy->constraints, ret = freq_qos_add_request(&policy->constraints,
policy->min_freq_req, FREQ_QOS_MIN, policy->min_freq_req, FREQ_QOS_MIN,
policy->min); FREQ_QOS_MIN_DEFAULT_VALUE);
if (ret < 0) { if (ret < 0) {
/* /*
* So we don't call freq_qos_remove_request() for an * So we don't call freq_qos_remove_request() for an
...@@ -1420,7 +1420,7 @@ static int cpufreq_online(unsigned int cpu) ...@@ -1420,7 +1420,7 @@ static int cpufreq_online(unsigned int cpu)
ret = freq_qos_add_request(&policy->constraints, ret = freq_qos_add_request(&policy->constraints,
policy->max_freq_req, FREQ_QOS_MAX, policy->max_freq_req, FREQ_QOS_MAX,
policy->max); FREQ_QOS_MAX_DEFAULT_VALUE);
if (ret < 0) { if (ret < 0) {
policy->max_freq_req = NULL; policy->max_freq_req = NULL;
goto out_destroy_policy; goto out_destroy_policy;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册