summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2014-02-26 13:42:04 +0100
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:47:09 +0900
commit142597e684f0ed0cf6145c4ed7aa551939688e00 (patch)
tree5a905828bdc60e7ba8036ffe5c972e85eb87f82b /drivers/cpufreq/cpufreq_ondemand.c
parent1fec8af8dc1cfc22c9ec11e7e6bf455e139cb9de (diff)
downloadlinux-3.10-142597e684f0ed0cf6145c4ed7aa551939688e00.tar.gz
linux-3.10-142597e684f0ed0cf6145c4ed7aa551939688e00.tar.bz2
linux-3.10-142597e684f0ed0cf6145c4ed7aa551939688e00.zip
cpufreq:LAB:ondemand: Ondemand governor adjustments necessary for correct LAB operation
Ondemand code needs to be slightly modified for LAB governor operation. The biggest problem is with the update_sampling_rate function, which shall not be executed with wrong governor. Change-Id: I149204bda15b11546c57a77a75a51c4f4f8522b8 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index d49855d72d5..85c4f566090 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -37,7 +37,7 @@
#define MIN_FREQUENCY_UP_THRESHOLD (11)
#define MAX_FREQUENCY_UP_THRESHOLD (100)
-static DEFINE_PER_CPU(struct od_cpu_dbs_info_s, od_cpu_dbs_info);
+DEFINE_PER_CPU(struct od_cpu_dbs_info_s, od_cpu_dbs_info);
struct od_ops od_ops;
@@ -162,7 +162,7 @@ static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq)
* (default), then we try to increase frequency. Else, we adjust the frequency
* proportional to load.
*/
-static void od_check_cpu(int cpu, unsigned int load)
+void od_check_cpu(int cpu, unsigned int load)
{
struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
struct cpufreq_policy *policy = dbs_info->cdbs.cur_policy;
@@ -247,6 +247,9 @@ max_delay:
/************************** sysfs interface ************************/
static struct common_dbs_data od_dbs_cdata;
+#ifdef CONFIG_CPU_FREQ_GOV_LAB
+extern struct cpufreq_governor cpufreq_gov_lab;
+#endif
/**
* update_sampling_rate - update sampling rate effective immediately if needed.
* @new_rate: new sampling rate
@@ -260,7 +263,7 @@ static struct common_dbs_data od_dbs_cdata;
* reducing the sampling rate, we need to make the new value effective
* immediately.
*/
-static void update_sampling_rate(struct dbs_data *dbs_data,
+void update_sampling_rate(struct dbs_data *dbs_data,
unsigned int new_rate)
{
struct od_dbs_tuners *od_tuners = dbs_data->tuners;
@@ -277,7 +280,12 @@ static void update_sampling_rate(struct dbs_data *dbs_data,
policy = cpufreq_cpu_get(cpu);
if (!policy)
continue;
+#ifdef CONFIG_CPU_FREQ_GOV_LAB
+ if (policy->governor != &cpufreq_gov_ondemand &&
+ policy->governor != &cpufreq_gov_lab) {
+#else
if (policy->governor != &cpufreq_gov_ondemand) {
+#endif
cpufreq_cpu_put(policy);
continue;
}