diff options
author | Liao Chang <liaochang1@huawei.com> | 2023-08-15 03:40:17 +0200 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2023-08-17 10:42:11 +0200 |
commit | 6a4fec4f6d30a325a1b27be70729145484e6fe9f (patch) | |
tree | 08daba35a6eafc503e271906adab47782e5310ae /drivers/cpufreq | |
parent | cpufreq: Prefer to print cpuid in MIN/MAX QoS register error message (diff) | |
download | linux-6a4fec4f6d30a325a1b27be70729145484e6fe9f.tar.xz linux-6a4fec4f6d30a325a1b27be70729145484e6fe9f.zip |
cpufreq: cppc: cppc_cpufreq_get_rate() returns zero in all error cases.
The cpufreq framework used to use the zero of return value to reflect
the cppc_cpufreq_get_rate() had failed to get current frequecy and treat
all positive integer to be succeed. Since cppc_get_perf_ctrs() returns a
negative integer in error case, so it is better to convert the value to
zero as the return value of cppc_cpufreq_get_rate().
Signed-off-by: Liao Chang <liaochang1@huawei.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cppc_cpufreq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c index 022e3555407c..05642759faee 100644 --- a/drivers/cpufreq/cppc_cpufreq.c +++ b/drivers/cpufreq/cppc_cpufreq.c @@ -849,13 +849,13 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu) ret = cppc_get_perf_ctrs(cpu, &fb_ctrs_t0); if (ret) - return ret; + return 0; udelay(2); /* 2usec delay between sampling */ ret = cppc_get_perf_ctrs(cpu, &fb_ctrs_t1); if (ret) - return ret; + return 0; delivered_perf = cppc_perf_from_fbctrs(cpu_data, &fb_ctrs_t0, &fb_ctrs_t1); |