Commit c5611bd1 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] use latency in nanoseconds

sometimes nanoseconds are used, sometimes microseconds, sometimes even something else.
parent ed576c7d
...@@ -172,7 +172,7 @@ static int integrator_cpufreq_init(struct cpufreq_policy *policy) ...@@ -172,7 +172,7 @@ static int integrator_cpufreq_init(struct cpufreq_policy *policy)
policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.max_freq = 160000; policy->cpuinfo.max_freq = 160000;
policy->cpuinfo.min_freq = 12000; policy->cpuinfo.min_freq = 12000;
policy->cpuinfo.transition_latency = 1000; /* 1 ms, assumed */ policy->cpuinfo.transition_latency = 1000000; /* 1 ms, assumed */
policy->cur = policy->min = policy->max = policy->cur = policy->min = policy->max =
icst525_khz(&cclk_params, vco); /* current freq */ icst525_khz(&cclk_params, vco); /* current freq */
......
...@@ -578,8 +578,8 @@ acpi_cpufreq_cpu_init ( ...@@ -578,8 +578,8 @@ acpi_cpufreq_cpu_init (
/* detect transition latency */ /* detect transition latency */
policy->cpuinfo.transition_latency = 0; policy->cpuinfo.transition_latency = 0;
for (i=0;i<perf->state_count;i++) { for (i=0;i<perf->state_count;i++) {
if (perf->states[i].transition_latency > policy->cpuinfo.transition_latency) if ((perf->states[i].transition_latency * 1000) > policy->cpuinfo.transition_latency)
policy->cpuinfo.transition_latency = perf->states[i].transition_latency; policy->cpuinfo.transition_latency = perf->states[i].transition_latency * 1000;
} }
policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cur = perf->states[pr->limit.state.px].core_frequency * 1000; policy->cur = perf->states[pr->limit.state.px].core_frequency * 1000;
......
...@@ -255,7 +255,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) ...@@ -255,7 +255,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */ /* cpuinfo and default policy values */
policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.transition_latency = 1000; policy->cpuinfo.transition_latency = 1000000; /* assumed */
policy->cur = stock_freq; policy->cur = stock_freq;
return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]); return cpufreq_frequency_table_cpuinfo(policy, &p4clockmod_table[0]);
......
...@@ -387,7 +387,11 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy) ...@@ -387,7 +387,11 @@ static int __init powernow_cpu_init (struct cpufreq_policy *policy)
minimum_speed, maximum_speed); minimum_speed, maximum_speed);
policy->governor = CPUFREQ_DEFAULT_GOVERNOR; policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.transition_latency = latency;
/* latency is in 10 ns (look for SGTC above) for each VID
* and FID transition, so multiply that value with 20 */
policy->cpuinfo.transition_latency = latency * 20;
policy->cur = maximum_speed; policy->cur = maximum_speed;
return cpufreq_frequency_table_cpuinfo(policy, powernow_table); return cpufreq_frequency_table_cpuinfo(policy, powernow_table);
......
...@@ -954,9 +954,10 @@ powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -954,9 +954,10 @@ powernowk8_cpu_init(struct cpufreq_policy *pol)
pol->governor = CPUFREQ_DEFAULT_GOVERNOR; pol->governor = CPUFREQ_DEFAULT_GOVERNOR;
/* Take a crude guess here. */ /* Take a crude guess here.
pol->cpuinfo.transition_latency = ((rvo + 8) * vstable * VST_UNITS_20US) * That guess was in microseconds, so multply with 1000 */
+ (3 * (1 << irt) * 10); pol->cpuinfo.transition_latency = (((rvo + 8) * vstable * VST_UNITS_20US)
+ (3 * (1 << irt) * 10)) * 1000;
if (query_current_values_with_pending_wait()) if (query_current_values_with_pending_wait())
return -EIO; return -EIO;
......
...@@ -57,7 +57,7 @@ struct cpufreq_governor; ...@@ -57,7 +57,7 @@ struct cpufreq_governor;
struct cpufreq_cpuinfo { struct cpufreq_cpuinfo {
unsigned int max_freq; unsigned int max_freq;
unsigned int min_freq; unsigned int min_freq;
unsigned int transition_latency; /* in 10^(-9) s */ unsigned int transition_latency; /* in 10^(-9) s = nanoseconds */
}; };
struct cpufreq_real_policy { struct cpufreq_real_policy {
......
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