Commit e40e7b25 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

cpufreq: governor: Rename cpu_common_dbs_info to policy_dbs_info

The struct cpu_common_dbs_info structure represents the per-policy
part of the governor data (for the ondemand and conservative
governors), but its name doesn't reflect its purpose.

Rename it to struct policy_dbs_info and rename variables related to
it accordingly.

No functional changes.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent ea59ee0d
...@@ -47,7 +47,7 @@ static inline unsigned int get_freq_target(struct cs_dbs_tuners *cs_tuners, ...@@ -47,7 +47,7 @@ static inline unsigned int get_freq_target(struct cs_dbs_tuners *cs_tuners,
static void cs_check_cpu(int cpu, unsigned int load) static void cs_check_cpu(int cpu, unsigned int load)
{ {
struct cs_cpu_dbs_info_s *dbs_info = &per_cpu(cs_cpu_dbs_info, cpu); struct cs_cpu_dbs_info_s *dbs_info = &per_cpu(cs_cpu_dbs_info, cpu);
struct cpufreq_policy *policy = dbs_info->cdbs.shared->policy; struct cpufreq_policy *policy = dbs_info->cdbs.policy_dbs->policy;
struct dbs_data *dbs_data = policy->governor_data; struct dbs_data *dbs_data = policy->governor_data;
struct cs_dbs_tuners *cs_tuners = dbs_data->tuners; struct cs_dbs_tuners *cs_tuners = dbs_data->tuners;
......
This diff is collapsed.
...@@ -131,7 +131,7 @@ static void *get_cpu_dbs_info_s(int cpu) \ ...@@ -131,7 +131,7 @@ static void *get_cpu_dbs_info_s(int cpu) \
*/ */
/* Common to all CPUs of a policy */ /* Common to all CPUs of a policy */
struct cpu_common_dbs_info { struct policy_dbs_info {
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
/* /*
* Per policy mutex that serializes load evaluation from limit-change * Per policy mutex that serializes load evaluation from limit-change
...@@ -146,10 +146,10 @@ struct cpu_common_dbs_info { ...@@ -146,10 +146,10 @@ struct cpu_common_dbs_info {
struct work_struct work; struct work_struct work;
}; };
static inline void gov_update_sample_delay(struct cpu_common_dbs_info *shared, static inline void gov_update_sample_delay(struct policy_dbs_info *policy_dbs,
unsigned int delay_us) unsigned int delay_us)
{ {
shared->sample_delay_ns = delay_us * NSEC_PER_USEC; policy_dbs->sample_delay_ns = delay_us * NSEC_PER_USEC;
} }
/* Per cpu structures */ /* Per cpu structures */
...@@ -165,7 +165,7 @@ struct cpu_dbs_info { ...@@ -165,7 +165,7 @@ struct cpu_dbs_info {
*/ */
unsigned int prev_load; unsigned int prev_load;
struct update_util_data update_util; struct update_util_data update_util;
struct cpu_common_dbs_info *shared; struct policy_dbs_info *policy_dbs;
}; };
struct od_cpu_dbs_info_s { struct od_cpu_dbs_info_s {
......
...@@ -151,7 +151,7 @@ static void dbs_freq_increase(struct cpufreq_policy *policy, unsigned int freq) ...@@ -151,7 +151,7 @@ static void dbs_freq_increase(struct cpufreq_policy *policy, unsigned int freq)
static void od_check_cpu(int cpu, unsigned int load) static 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 od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
struct cpufreq_policy *policy = dbs_info->cdbs.shared->policy; struct cpufreq_policy *policy = dbs_info->cdbs.policy_dbs->policy;
struct dbs_data *dbs_data = policy->governor_data; struct dbs_data *dbs_data = policy->governor_data;
struct od_dbs_tuners *od_tuners = dbs_data->tuners; struct od_dbs_tuners *od_tuners = dbs_data->tuners;
...@@ -255,20 +255,20 @@ static void update_sampling_rate(struct dbs_data *dbs_data, ...@@ -255,20 +255,20 @@ static void update_sampling_rate(struct dbs_data *dbs_data,
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
struct od_cpu_dbs_info_s *dbs_info; struct od_cpu_dbs_info_s *dbs_info;
struct cpu_dbs_info *cdbs; struct cpu_dbs_info *cdbs;
struct cpu_common_dbs_info *shared; struct policy_dbs_info *policy_dbs;
dbs_info = &per_cpu(od_cpu_dbs_info, cpu); dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
cdbs = &dbs_info->cdbs; cdbs = &dbs_info->cdbs;
shared = cdbs->shared; policy_dbs = cdbs->policy_dbs;
/* /*
* A valid shared and shared->policy means governor hasn't * A valid policy_dbs and policy_dbs->policy means governor
* stopped or exited yet. * hasn't stopped or exited yet.
*/ */
if (!shared || !shared->policy) if (!policy_dbs || !policy_dbs->policy)
continue; continue;
policy = shared->policy; policy = policy_dbs->policy;
/* clear all CPUs of this policy */ /* clear all CPUs of this policy */
cpumask_andnot(&cpumask, &cpumask, policy->cpus); cpumask_andnot(&cpumask, &cpumask, policy->cpus);
...@@ -280,7 +280,7 @@ static void update_sampling_rate(struct dbs_data *dbs_data, ...@@ -280,7 +280,7 @@ static void update_sampling_rate(struct dbs_data *dbs_data,
* multiple policies that are governed by the same dbs_data. * multiple policies that are governed by the same dbs_data.
*/ */
if (dbs_data == policy->governor_data) { if (dbs_data == policy->governor_data) {
mutex_lock(&shared->timer_mutex); mutex_lock(&policy_dbs->timer_mutex);
/* /*
* On 32-bit architectures this may race with the * On 32-bit architectures this may race with the
* sample_delay_ns read in dbs_update_util_handler(), * sample_delay_ns read in dbs_update_util_handler(),
...@@ -299,8 +299,8 @@ static void update_sampling_rate(struct dbs_data *dbs_data, ...@@ -299,8 +299,8 @@ static void update_sampling_rate(struct dbs_data *dbs_data,
* too big and it will be corrected next time a sample * too big and it will be corrected next time a sample
* is taken, so it shouldn't be significant. * is taken, so it shouldn't be significant.
*/ */
gov_update_sample_delay(shared, new_rate); gov_update_sample_delay(policy_dbs, new_rate);
mutex_unlock(&shared->timer_mutex); mutex_unlock(&policy_dbs->timer_mutex);
} }
} }
...@@ -573,16 +573,16 @@ static void od_set_powersave_bias(unsigned int powersave_bias) ...@@ -573,16 +573,16 @@ static void od_set_powersave_bias(unsigned int powersave_bias)
get_online_cpus(); get_online_cpus();
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
struct cpu_common_dbs_info *shared; struct policy_dbs_info *policy_dbs;
if (cpumask_test_cpu(cpu, &done)) if (cpumask_test_cpu(cpu, &done))
continue; continue;
shared = per_cpu(od_cpu_dbs_info, cpu).cdbs.shared; policy_dbs = per_cpu(od_cpu_dbs_info, cpu).cdbs.policy_dbs;
if (!shared) if (!policy_dbs)
continue; continue;
policy = shared->policy; policy = policy_dbs->policy;
cpumask_or(&done, &done, policy->cpus); cpumask_or(&done, &done, policy->cpus);
if (policy->governor != CPU_FREQ_GOV_ONDEMAND) if (policy->governor != CPU_FREQ_GOV_ONDEMAND)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment