Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119385
b: refs/heads/master
c: a266d9f
h: refs/heads/master
i:
  119383: 9b0df35
v: v3
  • Loading branch information
Andreas Herrmann authored and Dave Jones committed Nov 25, 2008
1 parent de2dd7e commit 388cc8d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 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: 121fe86bdf062af3fed1e998c08c3c272ae6dc99
refs/heads/master: a266d9f1253a38ec2d5655ebcd6846298b0554f4
18 changes: 15 additions & 3 deletions trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,20 @@ static int query_current_values_with_pending_wait(struct powernow_k8_data *data)
u32 i = 0;

if (cpu_family == CPU_HW_PSTATE) {
rdmsr(MSR_PSTATE_STATUS, lo, hi);
i = lo & HW_PSTATE_MASK;
data->currpstate = i;
if (data->currpstate == HW_PSTATE_INVALID) {
/* read (initial) hw pstate if not yet set */
rdmsr(MSR_PSTATE_STATUS, lo, hi);
i = lo & HW_PSTATE_MASK;

/*
* a workaround for family 11h erratum 311 might cause
* an "out-of-range Pstate if the core is in Pstate-0
*/
if (i >= data->numps)
data->currpstate = HW_PSTATE_0;
else
data->currpstate = i;
}
return 0;
}
do {
Expand Down Expand Up @@ -1121,6 +1132,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
}

data->cpu = pol->cpu;
data->currpstate = HW_PSTATE_INVALID;

if (powernow_k8_cpu_init_acpi(data)) {
/*
Expand Down
17 changes: 16 additions & 1 deletion trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
* http://www.gnu.org/licenses/gpl.html
*/


enum pstate {
HW_PSTATE_INVALID = 0xff,
HW_PSTATE_0 = 0,
HW_PSTATE_1 = 1,
HW_PSTATE_2 = 2,
HW_PSTATE_3 = 3,
HW_PSTATE_4 = 4,
HW_PSTATE_5 = 5,
HW_PSTATE_6 = 6,
HW_PSTATE_7 = 7,
};

struct powernow_k8_data {
unsigned int cpu;

Expand All @@ -23,7 +36,9 @@ struct powernow_k8_data {
u32 exttype; /* extended interface = 1 */

/* keep track of the current fid / vid or pstate */
u32 currvid, currfid, currpstate;
u32 currvid;
u32 currfid;
enum pstate currpstate;

/* the powernow_table includes all frequency and vid/fid pairings:
* fid are the lower 8 bits of the index, vid are the upper 8 bits.
Expand Down

0 comments on commit 388cc8d

Please sign in to comment.