aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c9
-rw-r--r--drivers/cpufreq/cpufreq_stats.c4
2 files changed, 9 insertions, 4 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index b735458c6e3a..563dcc82b902 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -373,8 +373,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
373 cpumask_t online_policy_cpus; 373 cpumask_t online_policy_cpus;
374 struct drv_cmd cmd; 374 struct drv_cmd cmd;
375 unsigned int msr; 375 unsigned int msr;
376 unsigned int next_state = 0; 376 unsigned int next_state = 0; /* Index into freq_table */
377 unsigned int next_perf_state = 0; 377 unsigned int next_perf_state = 0; /* Index into perf table */
378 unsigned int i; 378 unsigned int i;
379 int result = 0; 379 int result = 0;
380 380
@@ -439,8 +439,8 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
439 else 439 else
440 cpu_set(policy->cpu, cmd.mask); 440 cpu_set(policy->cpu, cmd.mask);
441 441
442 freqs.old = data->freq_table[perf->state].frequency; 442 freqs.old = perf->states[perf->state].core_frequency * 1000;
443 freqs.new = data->freq_table[next_perf_state].frequency; 443 freqs.new = data->freq_table[next_state].frequency;
444 for_each_cpu_mask(i, cmd.mask) { 444 for_each_cpu_mask(i, cmd.mask) {
445 freqs.cpu = i; 445 freqs.cpu = i;
446 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 446 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
@@ -677,6 +677,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
677 valid_states++; 677 valid_states++;
678 } 678 }
679 data->freq_table[valid_states].frequency = CPUFREQ_TABLE_END; 679 data->freq_table[valid_states].frequency = CPUFREQ_TABLE_END;
680 perf->state = 0;
680 681
681 result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table); 682 result = cpufreq_frequency_table_cpuinfo(policy, data->freq_table);
682 if (result) 683 if (result)
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 6742b1adf2c8..91ad342a6051 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -285,6 +285,7 @@ cpufreq_stat_notifier_trans (struct notifier_block *nb, unsigned long val,
285 stat = cpufreq_stats_table[freq->cpu]; 285 stat = cpufreq_stats_table[freq->cpu];
286 if (!stat) 286 if (!stat)
287 return 0; 287 return 0;
288
288 old_index = freq_table_get_index(stat, freq->old); 289 old_index = freq_table_get_index(stat, freq->old);
289 new_index = freq_table_get_index(stat, freq->new); 290 new_index = freq_table_get_index(stat, freq->new);
290 291
@@ -292,6 +293,9 @@ cpufreq_stat_notifier_trans (struct notifier_block *nb, unsigned long val,
292 if (old_index == new_index) 293 if (old_index == new_index)
293 return 0; 294 return 0;
294 295
296 if (old_index == -1 || new_index == -1)
297 return 0;
298
295 spin_lock(&cpufreq_stats_lock); 299 spin_lock(&cpufreq_stats_lock);
296 stat->last_index = new_index; 300 stat->last_index = new_index;
297#ifdef CONFIG_CPU_FREQ_STAT_DETAILS 301#ifdef CONFIG_CPU_FREQ_STAT_DETAILS