author | Tao Zeng <tao.zeng@amlogic.com> | 2015-09-10 02:12:45 (GMT) |
---|---|---|
committer | Tao Zeng <tao.zeng@amlogic.com> | 2015-09-10 02:12:45 (GMT) |
commit | 75a30bf9c036ce178e388ce8bc781cd025c8b889 (patch) | |
tree | 14518c66cedfdfb8e0d1f05b78af83dfac404a14 | |
parent | 23df120e6a04f694b5e9bc99346781fb3b86583b (diff) | |
download | thermal-75a30bf9c036ce178e388ce8bc781cd025c8b889.zip thermal-75a30bf9c036ce178e388ce8bc781cd025c8b889.tar.gz thermal-75a30bf9c036ce178e388ce8bc781cd025c8b889.tar.bz2 |
PD#111584: thermal: change cpufreq get API to avoid dead lock
In kernel 3.14, cpufreq driver use rw lock to protect policy data,
so you need put policy after get. We changed a simple and safe API
just for get cpu current frequent.
Change-Id: I48721431e53a76414637a0874c7388458b73303b
-rw-r--r-- | amlogic_thermal_module.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/amlogic_thermal_module.c b/amlogic_thermal_module.c index 8ee83b6..3965d06 100644 --- a/amlogic_thermal_module.c +++ b/amlogic_thermal_module.c @@ -378,14 +378,10 @@ EXPORT_SYMBOL(thermal_alloc); static void thermal_work(struct work_struct *work) { - struct cpufreq_policy *policy = cpufreq_cpu_get(0); struct amlogic_thermal_platform_data *pdata; - int cpu_freq = 0; + int cpu_freq = cpufreq_quick_get(0); pdata = container_of((struct delayed_work *)work, struct amlogic_thermal_platform_data, thermal_work); - if (policy) { - cpu_freq = policy->cur; - } if (pdata->temp_valid) keep_mode_work(pdata, cpu_freq); if (pdata->mode == THERMAL_DEVICE_ENABLED) { // no need to do this work again if thermal disabled |