From 75a30bf9c036ce178e388ce8bc781cd025c8b889 Mon Sep 17 00:00:00 2001 From: Tao Zeng Date: Thu, 10 Sep 2015 02:12:45 +0000 Subject: 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 --- 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 -- cgit