Commit c4719563 authored by Jie Zhan's avatar Jie Zhan Committed by Viresh Kumar
Browse files

cppc_cpufreq: Use desired perf if feedback ctrs are 0 or unchanged



The CPPC performance feedback counters could be 0 or unchanged when the
target cpu is in a low-power idle state, e.g. power-gated or clock-gated.

When the counters are 0, cppc_cpufreq_get_rate() returns 0 KHz, which makes
cpufreq_online() get a false error and fail to generate a cpufreq policy.

When the counters are unchanged, the existing cppc_perf_from_fbctrs()
returns a cached desired perf, but some platforms may update the real
frequency back to the desired perf reg.

For the above cases in cppc_cpufreq_get_rate(), get the latest desired perf
from the CPPC reg to reflect the frequency because some platforms may
update the actual frequency back there; if failed, use the cached desired
perf.

Fixes: 6a4fec4f ("cpufreq: cppc: cppc_cpufreq_get_rate() returns zero in all error cases.")
Signed-off-by: default avatarJie Zhan <zhanjie9@hisilicon.com>
Reviewed-by: default avatarZeng Heng <zengheng4@huawei.com>
Reviewed-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
Reviewed-by: default avatarHuisong Li <lihuisong@huawei.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent dfb6e2f5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment