]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
thermal: cpu_cooling: use cpufreq_policy to register cooling device
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 25 Apr 2017 10:27:14 +0000 (15:57 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Sun, 28 May 2017 00:32:24 +0000 (17:32 -0700)
commit4d753aa7b6279e4b7d338947a434689962f430d1
tree07114a3ef8781b49b4254df85c3ca83e60c165f6
parent18f301c934db0f7bae4e7c12e941bce11d67aec5
thermal: cpu_cooling: use cpufreq_policy to register cooling device

The CPU cooling driver uses the cpufreq policy, to get clip_cpus, the
frequency table, etc. Most of the callers of CPU cooling driver's
registration routines have the cpufreq policy with them, but they only
pass the policy->related_cpus cpumask. The __cpufreq_cooling_register()
routine then gets the policy by itself and uses it.

It would be much better if the callers can pass the policy instead
directly. This also fixes a basic design flaw, where the policy can be
freed while the CPU cooling driver is still active.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/cpufreq/arm_big_little.c
drivers/cpufreq/cpufreq-dt.c
drivers/cpufreq/dbx500-cpufreq.c
drivers/cpufreq/mt8173-cpufreq.c
drivers/cpufreq/qoriq-cpufreq.c
drivers/thermal/cpu_cooling.c
drivers/thermal/imx_thermal.c
drivers/thermal/ti-soc-thermal/ti-thermal-common.c
include/linux/cpu_cooling.h