Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351036
b: refs/heads/master
c: b394058
h: refs/heads/master
v: v3
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Feb 2, 2013
1 parent c0f4563 commit efba7d0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4447266b842d27f77b017a59eb9dc38ad7b299f1
refs/heads/master: b394058f064848deac7a7cd6942b6521d7b3fe1d
4 changes: 4 additions & 0 deletions trunk/drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,9 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
policy->cpu, event);
ret = policy->governor->governor(policy, event);

if (!policy->governor->initialized && (event == CPUFREQ_GOV_START))
policy->governor->initialized = 1;

/* we keep one module reference alive for
each CPU governed by this CPU */
if ((event != CPUFREQ_GOV_START) || ret)
Expand All @@ -1585,6 +1588,7 @@ int cpufreq_register_governor(struct cpufreq_governor *governor)

mutex_lock(&cpufreq_governor_mutex);

governor->initialized = 0;
err = -EBUSY;
if (__find_governor(governor->name) == NULL) {
err = 0;
Expand Down
24 changes: 16 additions & 8 deletions trunk/drivers/cpufreq/cpufreq_governor.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ int cpufreq_governor_dbs(struct dbs_data *dbs_data,
return rc;
}

/* policy latency is in nS. Convert it to uS first */
latency = policy->cpuinfo.transition_latency / 1000;
if (latency == 0)
latency = 1;

/*
* conservative does not implement micro like ondemand
* governor, thus we are bound to jiffes/HZ
Expand All @@ -270,20 +265,33 @@ int cpufreq_governor_dbs(struct dbs_data *dbs_data,
cpufreq_register_notifier(cs_ops->notifier_block,
CPUFREQ_TRANSITION_NOTIFIER);

dbs_data->min_sampling_rate = MIN_SAMPLING_RATE_RATIO *
jiffies_to_usecs(10);
if (!policy->governor->initialized)
dbs_data->min_sampling_rate =
MIN_SAMPLING_RATE_RATIO *
jiffies_to_usecs(10);
} else {
od_dbs_info->rate_mult = 1;
od_dbs_info->sample_type = OD_NORMAL_SAMPLE;
od_ops->powersave_bias_init_cpu(cpu);
od_tuners->io_is_busy = od_ops->io_busy();

if (!policy->governor->initialized)
od_tuners->io_is_busy = od_ops->io_busy();
}

if (policy->governor->initialized)
goto unlock;

/* policy latency is in nS. Convert it to uS first */
latency = policy->cpuinfo.transition_latency / 1000;
if (latency == 0)
latency = 1;

/* Bring kernel and HW constraints together */
dbs_data->min_sampling_rate = max(dbs_data->min_sampling_rate,
MIN_LATENCY_MULTIPLIER * latency);
*sampling_rate = max(dbs_data->min_sampling_rate, latency *
LATENCY_MULTIPLIER);
unlock:
mutex_unlock(&dbs_data->mutex);

/* Initiate timer time stamp */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu

struct cpufreq_governor {
char name[CPUFREQ_NAME_LEN];
int initialized;
int (*governor) (struct cpufreq_policy *policy,
unsigned int event);
ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
Expand Down

0 comments on commit efba7d0

Please sign in to comment.