diff options
author | Lukasz Majewski <l.majewski@samsung.com> | 2014-02-26 13:42:04 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-03-20 17:44:11 +0900 |
commit | a8cc31c82c6a80fca0491b809c3cdecb0865c67d (patch) | |
tree | 7a4da7cfb701e5ad8afd4d47059c67540b0bc0a2 | |
parent | 29196a3ad29f64af169d76cf37cc75a5af996c4f (diff) | |
download | linux-3.10-a8cc31c82c6a80fca0491b809c3cdecb0865c67d.tar.gz linux-3.10-a8cc31c82c6a80fca0491b809c3cdecb0865c67d.tar.bz2 linux-3.10-a8cc31c82c6a80fca0491b809c3cdecb0865c67d.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>
-rw-r--r-- | drivers/cpufreq/cpufreq_governor.h | 3 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 14 |
2 files changed, 14 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.h b/drivers/cpufreq/cpufreq_governor.h index a3cf7a82721..256c50d4197 100644 --- a/drivers/cpufreq/cpufreq_governor.h +++ b/drivers/cpufreq/cpufreq_governor.h @@ -290,6 +290,9 @@ void od_unregister_powersave_bias_handler(void); void od_dbs_timer(struct work_struct *work); int od_init(struct dbs_data *dbs_data); void od_exit(struct dbs_data *dbs_data); +void od_check_cpu(int cpu, unsigned int load_freq); +void update_sampling_rate(struct dbs_data *dbs_data, + unsigned int new_rate); extern struct od_ops od_ops; 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; } |