Commit a1f34321 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Make powernow-k8 cpufreq control work again

From: Pavel Machek <pavel@suse.cz>

We curretly have an off-by-factor-of-1000:

cat /proc/cpufreq

          minimum CPU frequency  -  maximum CPU frequency  -  policy
CPU  0         2000 kHz (100 %)  -       2000 kHz (100 %)  -  powersave


I do not have explanation why it is 2MHz - 2MHz.  On my system I removed
bug which prevented my system from being reported as 0.8MHz - 1.8MHz.  (And
modulo cosmetic uglyness, it worked).

This fixes cosmetic uglyness, adds proper copyrights, removes warning
"untested on PREEMPT" (someone tested it, and makes it easier to override
PST by user (eMachine users will need that one).
parent f08519cf
......@@ -8,6 +8,8 @@
*
* Based on the powernow-k7.c module written by Dave Jones.
* (C) 2003 Dave Jones <davej@codemonkey.ork.uk> on behalf of SuSE Labs
* (C) 2004 Dominik Brodowski <linux@brodo.de>
* (C) 2004 Pavel Machek <pavel@suse.cz>
* Licensed under the terms of the GNU GPL License version 2.
* Based upon datasheets & sample CPUs kindly provided by AMD.
*
......@@ -34,10 +36,6 @@
#define VERSION "version 1.00.08a"
#include "powernow-k8.h"
#ifdef CONFIG_PREEMPT
#warning this driver has not been tested on a preempt system
#endif
static u32 vstable; /* voltage stabalization time, from PSB, units 20 us */
static u32 plllock; /* pll lock time, from PSB, units 1 us */
static u32 numps; /* number of p-states, from PSB */
......@@ -636,13 +634,22 @@ find_psb_table(void)
return -ENOMEM;
}
for (j = 0; j < numps; j++) {
printk(KERN_INFO PFX " %d : fid 0x%x (%d MHz), vid 0x%x\n", j,
pst[j].fid, find_freq_from_fid(pst[j].fid), pst[j].vid);
for (j = 0; j < psb->numpstates; j++) {
powernow_table[j].index = pst[j].fid; /* lower 8 bits */
powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */
powernow_table[j].frequency = find_freq_from_fid(pst[j].fid);
}
/* If you want to override your frequency tables, this
is right place. */
for (j = 0; j < numps; j++) {
powernow_table[j].frequency = find_freq_from_fid(powernow_table[j].index & 0xff)*1000;
printk(KERN_INFO PFX " %d : fid 0x%x (%d MHz), vid 0x%x\n", j,
powernow_table[j].index & 0xff,
powernow_table[j].frequency/1000,
powernow_table[j].index >> 8);
}
powernow_table[numps].frequency = CPUFREQ_TABLE_END;
powernow_table[numps].index = 0;
......
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