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;
......
...@@ -163,15 +163,15 @@ void dbs_check_cpu(struct cpufreq_policy *policy, int cpu) ...@@ -163,15 +163,15 @@ void dbs_check_cpu(struct cpufreq_policy *policy, int cpu)
} }
EXPORT_SYMBOL_GPL(dbs_check_cpu); EXPORT_SYMBOL_GPL(dbs_check_cpu);
void gov_set_update_util(struct cpu_common_dbs_info *shared, void gov_set_update_util(struct policy_dbs_info *policy_dbs,
unsigned int delay_us) unsigned int delay_us)
{ {
struct cpufreq_policy *policy = shared->policy; struct cpufreq_policy *policy = policy_dbs->policy;
struct dbs_governor *gov = dbs_governor_of(policy); struct dbs_governor *gov = dbs_governor_of(policy);
int cpu; int cpu;
gov_update_sample_delay(shared, delay_us); gov_update_sample_delay(policy_dbs, delay_us);
shared->last_sample_time = 0; policy_dbs->last_sample_time = 0;
for_each_cpu(cpu, policy->cpus) { for_each_cpu(cpu, policy->cpus) {
struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu); struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu);
...@@ -191,40 +191,40 @@ static inline void gov_clear_update_util(struct cpufreq_policy *policy) ...@@ -191,40 +191,40 @@ static inline void gov_clear_update_util(struct cpufreq_policy *policy)
synchronize_rcu(); synchronize_rcu();
} }
static void gov_cancel_work(struct cpu_common_dbs_info *shared) static void gov_cancel_work(struct policy_dbs_info *policy_dbs)
{ {
/* Tell dbs_update_util_handler() to skip queuing up work items. */ /* Tell dbs_update_util_handler() to skip queuing up work items. */
atomic_inc(&shared->skip_work); atomic_inc(&policy_dbs->skip_work);
/* /*
* If dbs_update_util_handler() is already running, it may not notice * If dbs_update_util_handler() is already running, it may not notice
* the incremented skip_work, so wait for it to complete to prevent its * the incremented skip_work, so wait for it to complete to prevent its
* work item from being queued up after the cancel_work_sync() below. * work item from being queued up after the cancel_work_sync() below.
*/ */
gov_clear_update_util(shared->policy); gov_clear_update_util(policy_dbs->policy);
irq_work_sync(&shared->irq_work); irq_work_sync(&policy_dbs->irq_work);
cancel_work_sync(&shared->work); cancel_work_sync(&policy_dbs->work);
atomic_set(&shared->skip_work, 0); atomic_set(&policy_dbs->skip_work, 0);
} }
static void dbs_work_handler(struct work_struct *work) static void dbs_work_handler(struct work_struct *work)
{ {
struct cpu_common_dbs_info *shared = container_of(work, struct struct policy_dbs_info *policy_dbs;
cpu_common_dbs_info, work);
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
struct dbs_governor *gov; struct dbs_governor *gov;
unsigned int delay; unsigned int delay;
policy = shared->policy; policy_dbs = container_of(work, struct policy_dbs_info, work);
policy = policy_dbs->policy;
gov = dbs_governor_of(policy); gov = dbs_governor_of(policy);
/* /*
* Make sure cpufreq_governor_limits() isn't evaluating load or the * Make sure cpufreq_governor_limits() isn't evaluating load or the
* ondemand governor isn't updating the sampling rate in parallel. * ondemand governor isn't updating the sampling rate in parallel.
*/ */
mutex_lock(&shared->timer_mutex); mutex_lock(&policy_dbs->timer_mutex);
delay = gov->gov_dbs_timer(policy); delay = gov->gov_dbs_timer(policy);
shared->sample_delay_ns = jiffies_to_nsecs(delay); policy_dbs->sample_delay_ns = jiffies_to_nsecs(delay);
mutex_unlock(&shared->timer_mutex); mutex_unlock(&policy_dbs->timer_mutex);
/* /*
* If the atomic operation below is reordered with respect to the * If the atomic operation below is reordered with respect to the
...@@ -232,23 +232,23 @@ static void dbs_work_handler(struct work_struct *work) ...@@ -232,23 +232,23 @@ static void dbs_work_handler(struct work_struct *work)
* up using a stale sample delay value. * up using a stale sample delay value.
*/ */
smp_mb__before_atomic(); smp_mb__before_atomic();
atomic_dec(&shared->skip_work); atomic_dec(&policy_dbs->skip_work);
} }
static void dbs_irq_work(struct irq_work *irq_work) static void dbs_irq_work(struct irq_work *irq_work)
{ {
struct cpu_common_dbs_info *shared; struct policy_dbs_info *policy_dbs;
shared = container_of(irq_work, struct cpu_common_dbs_info, irq_work); policy_dbs = container_of(irq_work, struct policy_dbs_info, irq_work);
schedule_work(&shared->work); schedule_work(&policy_dbs->work);
} }
static inline void gov_queue_irq_work(struct cpu_common_dbs_info *shared) static inline void gov_queue_irq_work(struct policy_dbs_info *policy_dbs)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
irq_work_queue_on(&shared->irq_work, smp_processor_id()); irq_work_queue_on(&policy_dbs->irq_work, smp_processor_id());
#else #else
irq_work_queue(&shared->irq_work); irq_work_queue(&policy_dbs->irq_work);
#endif #endif
} }
...@@ -256,7 +256,7 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time, ...@@ -256,7 +256,7 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
unsigned long util, unsigned long max) unsigned long util, unsigned long max)
{ {
struct cpu_dbs_info *cdbs = container_of(data, struct cpu_dbs_info, update_util); struct cpu_dbs_info *cdbs = container_of(data, struct cpu_dbs_info, update_util);
struct cpu_common_dbs_info *shared = cdbs->shared; struct policy_dbs_info *policy_dbs = cdbs->policy_dbs;
/* /*
* The work may not be allowed to be queued up right now. * The work may not be allowed to be queued up right now.
...@@ -265,17 +265,17 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time, ...@@ -265,17 +265,17 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
* - The governor is being stopped. * - The governor is being stopped.
* - It is too early (too little time from the previous sample). * - It is too early (too little time from the previous sample).
*/ */
if (atomic_inc_return(&shared->skip_work) == 1) { if (atomic_inc_return(&policy_dbs->skip_work) == 1) {
u64 delta_ns; u64 delta_ns;
delta_ns = time - shared->last_sample_time; delta_ns = time - policy_dbs->last_sample_time;
if ((s64)delta_ns >= shared->sample_delay_ns) { if ((s64)delta_ns >= policy_dbs->sample_delay_ns) {
shared->last_sample_time = time; policy_dbs->last_sample_time = time;
gov_queue_irq_work(shared); gov_queue_irq_work(policy_dbs);
return; return;
} }
} }
atomic_dec(&shared->skip_work); atomic_dec(&policy_dbs->skip_work);
} }
static void set_sampling_rate(struct dbs_data *dbs_data, static void set_sampling_rate(struct dbs_data *dbs_data,
...@@ -291,41 +291,41 @@ static void set_sampling_rate(struct dbs_data *dbs_data, ...@@ -291,41 +291,41 @@ static void set_sampling_rate(struct dbs_data *dbs_data,
} }
} }
static int alloc_common_dbs_info(struct cpufreq_policy *policy, static int alloc_policy_dbs_info(struct cpufreq_policy *policy,
struct dbs_governor *gov) struct dbs_governor *gov)
{ {
struct cpu_common_dbs_info *shared; struct policy_dbs_info *policy_dbs;
int j; int j;
/* Allocate memory for the common information for policy->cpus */ /* Allocate memory for the common information for policy->cpus */
shared = kzalloc(sizeof(*shared), GFP_KERNEL); policy_dbs = kzalloc(sizeof(*policy_dbs), GFP_KERNEL);
if (!shared) if (!policy_dbs)
return -ENOMEM; return -ENOMEM;
/* Set shared for all CPUs, online+offline */ /* Set policy_dbs for all CPUs, online+offline */
for_each_cpu(j, policy->related_cpus) for_each_cpu(j, policy->related_cpus)
gov->get_cpu_cdbs(j)->shared = shared; gov->get_cpu_cdbs(j)->policy_dbs = policy_dbs;
mutex_init(&shared->timer_mutex); mutex_init(&policy_dbs->timer_mutex);
atomic_set(&shared->skip_work, 0); atomic_set(&policy_dbs->skip_work, 0);
init_irq_work(&shared->irq_work, dbs_irq_work); init_irq_work(&policy_dbs->irq_work, dbs_irq_work);
INIT_WORK(&shared->work, dbs_work_handler); INIT_WORK(&policy_dbs->work, dbs_work_handler);
return 0; return 0;
} }
static void free_common_dbs_info(struct cpufreq_policy *policy, static void free_policy_dbs_info(struct cpufreq_policy *policy,
struct dbs_governor *gov) struct dbs_governor *gov)
{ {
struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu); struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu);
struct cpu_common_dbs_info *shared = cdbs->shared; struct policy_dbs_info *policy_dbs = cdbs->policy_dbs;
int j; int j;
mutex_destroy(&shared->timer_mutex); mutex_destroy(&policy_dbs->timer_mutex);
for_each_cpu(j, policy->cpus) for_each_cpu(j, policy->cpus)
gov->get_cpu_cdbs(j)->shared = NULL; gov->get_cpu_cdbs(j)->policy_dbs = NULL;
kfree(shared); kfree(policy_dbs);
} }
static int cpufreq_governor_init(struct cpufreq_policy *policy) static int cpufreq_governor_init(struct cpufreq_policy *policy)
...@@ -343,7 +343,7 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy) ...@@ -343,7 +343,7 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy)
if (WARN_ON(have_governor_per_policy())) if (WARN_ON(have_governor_per_policy()))
return -EINVAL; return -EINVAL;
ret = alloc_common_dbs_info(policy, gov); ret = alloc_policy_dbs_info(policy, gov);
if (ret) if (ret)
return ret; return ret;
...@@ -356,7 +356,7 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy) ...@@ -356,7 +356,7 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy)
if (!dbs_data) if (!dbs_data)
return -ENOMEM; return -ENOMEM;
ret = alloc_common_dbs_info(policy, gov); ret = alloc_policy_dbs_info(policy, gov);
if (ret) if (ret)
goto free_dbs_data; goto free_dbs_data;
...@@ -364,7 +364,7 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy) ...@@ -364,7 +364,7 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy)
ret = gov->init(dbs_data, !policy->governor->initialized); ret = gov->init(dbs_data, !policy->governor->initialized);
if (ret) if (ret)
goto free_common_dbs_info; goto free_policy_dbs_info;
/* policy latency is in ns. Convert it to us first */ /* policy latency is in ns. Convert it to us first */
latency = policy->cpuinfo.transition_latency / 1000; latency = policy->cpuinfo.transition_latency / 1000;
...@@ -395,8 +395,8 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy) ...@@ -395,8 +395,8 @@ static int cpufreq_governor_init(struct cpufreq_policy *policy)
if (!have_governor_per_policy()) if (!have_governor_per_policy())
gov->gdbs_data = NULL; gov->gdbs_data = NULL;
gov->exit(dbs_data, !policy->governor->initialized); gov->exit(dbs_data, !policy->governor->initialized);
free_common_dbs_info: free_policy_dbs_info:
free_common_dbs_info(policy, gov); free_policy_dbs_info(policy, gov);
free_dbs_data: free_dbs_data:
kfree(dbs_data); kfree(dbs_data);
return ret; return ret;
...@@ -409,7 +409,7 @@ static int cpufreq_governor_exit(struct cpufreq_policy *policy) ...@@ -409,7 +409,7 @@ static int cpufreq_governor_exit(struct cpufreq_policy *policy)
struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu); struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu);
/* State should be equivalent to INIT */ /* State should be equivalent to INIT */
if (!cdbs->shared || cdbs->shared->policy) if (!cdbs->policy_dbs || cdbs->policy_dbs->policy)
return -EBUSY; return -EBUSY;
if (!--dbs_data->usage_count) { if (!--dbs_data->usage_count) {
...@@ -427,7 +427,7 @@ static int cpufreq_governor_exit(struct cpufreq_policy *policy) ...@@ -427,7 +427,7 @@ static int cpufreq_governor_exit(struct cpufreq_policy *policy)
policy->governor_data = NULL; policy->governor_data = NULL;
} }
free_common_dbs_info(policy, gov); free_policy_dbs_info(policy, gov);
return 0; return 0;
} }
...@@ -437,14 +437,14 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy) ...@@ -437,14 +437,14 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy)
struct dbs_data *dbs_data = policy->governor_data; struct dbs_data *dbs_data = policy->governor_data;
unsigned int sampling_rate, ignore_nice, j, cpu = policy->cpu; unsigned int sampling_rate, ignore_nice, j, cpu = policy->cpu;
struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu); struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu);
struct cpu_common_dbs_info *shared = cdbs->shared; struct policy_dbs_info *policy_dbs = cdbs->policy_dbs;
int io_busy = 0; int io_busy = 0;
if (!policy->cur) if (!policy->cur)
return -EINVAL; return -EINVAL;
/* State should be equivalent to INIT */ /* State should be equivalent to INIT */
if (!shared || shared->policy) if (!policy_dbs || policy_dbs->policy)
return -EBUSY; return -EBUSY;
if (gov->governor == GOV_CONSERVATIVE) { if (gov->governor == GOV_CONSERVATIVE) {
...@@ -477,7 +477,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy) ...@@ -477,7 +477,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy)
j_cdbs->update_util.func = dbs_update_util_handler; j_cdbs->update_util.func = dbs_update_util_handler;
} }
shared->policy = policy; policy_dbs->policy = policy;
if (gov->governor == GOV_CONSERVATIVE) { if (gov->governor == GOV_CONSERVATIVE) {
struct cs_cpu_dbs_info_s *cs_dbs_info = struct cs_cpu_dbs_info_s *cs_dbs_info =
...@@ -494,7 +494,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy) ...@@ -494,7 +494,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy)
od_ops->powersave_bias_init_cpu(cpu); od_ops->powersave_bias_init_cpu(cpu);
} }
gov_set_update_util(shared, sampling_rate); gov_set_update_util(policy_dbs, sampling_rate);
return 0; return 0;
} }
...@@ -502,14 +502,14 @@ static int cpufreq_governor_stop(struct cpufreq_policy *policy) ...@@ -502,14 +502,14 @@ static int cpufreq_governor_stop(struct cpufreq_policy *policy)
{ {
struct dbs_governor *gov = dbs_governor_of(policy); struct dbs_governor *gov = dbs_governor_of(policy);
struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu); struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu);
struct cpu_common_dbs_info *shared = cdbs->shared; struct policy_dbs_info *policy_dbs = cdbs->policy_dbs;
/* State should be equivalent to START */ /* State should be equivalent to START */
if (!shared || !shared->policy) if (!policy_dbs || !policy_dbs->policy)
return -EBUSY; return -EBUSY;
gov_cancel_work(shared); gov_cancel_work(policy_dbs);
shared->policy = NULL; policy_dbs->policy = NULL;
return 0; return 0;
} }
...@@ -521,18 +521,18 @@ static int cpufreq_governor_limits(struct cpufreq_policy *policy) ...@@ -521,18 +521,18 @@ static int cpufreq_governor_limits(struct cpufreq_policy *policy)
struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu); struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(cpu);
/* State should be equivalent to START */ /* State should be equivalent to START */
if (!cdbs->shared || !cdbs->shared->policy) if (!cdbs->policy_dbs || !cdbs->policy_dbs->policy)
return -EBUSY; return -EBUSY;
mutex_lock(&cdbs->shared->timer_mutex); mutex_lock(&cdbs->policy_dbs->timer_mutex);
if (policy->max < cdbs->shared->policy->cur) if (policy->max < cdbs->policy_dbs->policy->cur)
__cpufreq_driver_target(cdbs->shared->policy, policy->max, __cpufreq_driver_target(cdbs->policy_dbs->policy, policy->max,
CPUFREQ_RELATION_H); CPUFREQ_RELATION_H);
else if (policy->min > cdbs->shared->policy->cur) else if (policy->min > cdbs->policy_dbs->policy->cur)
__cpufreq_driver_target(cdbs->shared->policy, policy->min, __cpufreq_driver_target(cdbs->policy_dbs->policy, policy->min,
CPUFREQ_RELATION_L); CPUFREQ_RELATION_L);
dbs_check_cpu(policy, cpu); dbs_check_cpu(policy, cpu);
mutex_unlock(&cdbs->shared->timer_mutex); mutex_unlock(&cdbs->policy_dbs->timer_mutex);
return 0; return 0;
} }
......
...@@ -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