Skip to content

Commit

Permalink
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/davej/cpufreq

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect
  [CPUFREQ] powernow-k8: Don't notify of successful transition if we failed (vid case).
  [CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value.
  • Loading branch information
Linus Torvalds committed Jun 18, 2011
2 parents 95559f2 + fbb5b89 commit 2f48802
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions drivers/cpufreq/cpufreq_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,13 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb,
old_index = stat->last_index;
new_index = freq_table_get_index(stat, freq->new);

cpufreq_stats_update(freq->cpu);
if (old_index == new_index)
/* We can't do stat->time_in_state[-1]= .. */
if (old_index == -1 || new_index == -1)
return 0;

if (old_index == -1 || new_index == -1)
cpufreq_stats_update(freq->cpu);

if (old_index == new_index)
return 0;

spin_lock(&cpufreq_stats_lock);
Expand Down
6 changes: 5 additions & 1 deletion drivers/cpufreq/powernow-k8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,9 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
}

res = transition_fid_vid(data, fid, vid);
if (res)
return res;

freqs.new = find_khz_freq_from_fid(data->currfid);

for_each_cpu(i, data->available_cores) {
Expand All @@ -1101,7 +1104,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data,
/* get MSR index for hardware pstate transition */
pstate = index & HW_PSTATE_MASK;
if (pstate > data->max_hw_pstate)
return 0;
return -EINVAL;

freqs.old = find_khz_freq_from_pstate(data->powernow_table,
data->currpstate);
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
Expand Down

0 comments on commit 2f48802

Please sign in to comment.