diff options
author | Lukasz Luba <lukasz.luba@arm.com> | 2021-10-15 15:45:47 +0100 |
---|---|---|
committer | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2021-11-02 16:50:28 +0000 |
commit | 1cf7933f1f2cc81b7ae2202e5fbac24b3034e6c6 (patch) | |
tree | 4b51974b2b6a52d0009d37f1213fbef18b5ddf4a | |
parent | b9688c543c3bddbeb33d330b2b7e68b7751ca3e0 (diff) |
thermal: cpufreq_cooling: Use new thermal pressure update function
Thermal pressure provides a new API, which allows to use CPU frequency
as an argument. That removes the need of local conversion to capacity.
Use this new function and remove old conversion code.
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
-rw-r--r-- | drivers/thermal/cpufreq_cooling.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index 43b1ae8a77893..835c091ce818c 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -462,7 +462,6 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; struct cpumask *cpus; unsigned int frequency; - unsigned long max_capacity, capacity; int ret; /* Request state should be less than max_level */ @@ -479,10 +478,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, if (ret >= 0) { cpufreq_cdev->cpufreq_state = state; cpus = cpufreq_cdev->policy->related_cpus; - max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus)); - capacity = frequency * max_capacity; - capacity /= cpufreq_cdev->policy->cpuinfo.max_freq; - arch_set_thermal_pressure(cpus, max_capacity - capacity); + arch_thermal_pressure_update(cpus, frequency); ret = 0; } |