Commit 0e64a0c9 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] checkpatch cleanups for powernow-k8

This driver has so many long function names, and deep nested if's
The remaining warnings will need some code restructuring to clean up.
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 2b03f891
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/cpumask.h> #include <linux/cpumask.h>
#include <linux/sched.h> /* for current / set_cpus_allowed() */ #include <linux/sched.h> /* for current / set_cpus_allowed() */
#include <linux/io.h>
#include <linux/delay.h>
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/io.h>
#include <asm/delay.h>
#ifdef CONFIG_X86_POWERNOW_K8_ACPI #ifdef CONFIG_X86_POWERNOW_K8_ACPI
#include <linux/acpi.h> #include <linux/acpi.h>
...@@ -71,7 +71,8 @@ static u32 find_khz_freq_from_fid(u32 fid) ...@@ -71,7 +71,8 @@ static u32 find_khz_freq_from_fid(u32 fid)
return 1000 * find_freq_from_fid(fid); return 1000 * find_freq_from_fid(fid);
} }
static u32 find_khz_freq_from_pstate(struct cpufreq_frequency_table *data, u32 pstate) static u32 find_khz_freq_from_pstate(struct cpufreq_frequency_table *data,
u32 pstate)
{ {
return data[pstate].frequency; return data[pstate].frequency;
} }
...@@ -186,7 +187,9 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid) ...@@ -186,7 +187,9 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
return 1; return 1;
} }
lo = fid | (data->currvid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; lo = fid;
lo |= (data->currvid << MSR_C_LO_VID_SHIFT);
lo |= MSR_C_LO_INIT_FID_VID;
dprintk("writing fid 0x%x, lo 0x%x, hi 0x%x\n", dprintk("writing fid 0x%x, lo 0x%x, hi 0x%x\n",
fid, lo, data->plllock * PLL_LOCK_CONVERSION); fid, lo, data->plllock * PLL_LOCK_CONVERSION);
...@@ -194,7 +197,9 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid) ...@@ -194,7 +197,9 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
do { do {
wrmsr(MSR_FIDVID_CTL, lo, data->plllock * PLL_LOCK_CONVERSION); wrmsr(MSR_FIDVID_CTL, lo, data->plllock * PLL_LOCK_CONVERSION);
if (i++ > 100) { if (i++ > 100) {
printk(KERN_ERR PFX "Hardware error - pending bit very stuck - no further pstate changes possible\n"); printk(KERN_ERR PFX
"Hardware error - pending bit very stuck - "
"no further pstate changes possible\n");
return 1; return 1;
} }
} while (query_current_values_with_pending_wait(data)); } while (query_current_values_with_pending_wait(data));
...@@ -202,13 +207,15 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid) ...@@ -202,13 +207,15 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
count_off_irt(data); count_off_irt(data);
if (savevid != data->currvid) { if (savevid != data->currvid) {
printk(KERN_ERR PFX "vid change on fid trans, old 0x%x, new 0x%x\n", printk(KERN_ERR PFX
"vid change on fid trans, old 0x%x, new 0x%x\n",
savevid, data->currvid); savevid, data->currvid);
return 1; return 1;
} }
if (fid != data->currfid) { if (fid != data->currfid) {
printk(KERN_ERR PFX "fid trans failed, fid 0x%x, curr 0x%x\n", fid, printk(KERN_ERR PFX
"fid trans failed, fid 0x%x, curr 0x%x\n", fid,
data->currfid); data->currfid);
return 1; return 1;
} }
...@@ -228,7 +235,9 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid) ...@@ -228,7 +235,9 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
return 1; return 1;
} }
lo = data->currfid | (vid << MSR_C_LO_VID_SHIFT) | MSR_C_LO_INIT_FID_VID; lo = data->currfid;
lo |= (vid << MSR_C_LO_VID_SHIFT);
lo |= MSR_C_LO_INIT_FID_VID;
dprintk("writing vid 0x%x, lo 0x%x, hi 0x%x\n", dprintk("writing vid 0x%x, lo 0x%x, hi 0x%x\n",
vid, lo, STOP_GRANT_5NS); vid, lo, STOP_GRANT_5NS);
...@@ -236,20 +245,24 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid) ...@@ -236,20 +245,24 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
do { do {
wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS); wrmsr(MSR_FIDVID_CTL, lo, STOP_GRANT_5NS);
if (i++ > 100) { if (i++ > 100) {
printk(KERN_ERR PFX "internal error - pending bit very stuck - no further pstate changes possible\n"); printk(KERN_ERR PFX "internal error - pending bit "
"very stuck - no further pstate "
"changes possible\n");
return 1; return 1;
} }
} while (query_current_values_with_pending_wait(data)); } while (query_current_values_with_pending_wait(data));
if (savefid != data->currfid) { if (savefid != data->currfid) {
printk(KERN_ERR PFX "fid changed on vid trans, old 0x%x new 0x%x\n", printk(KERN_ERR PFX "fid changed on vid trans, old "
"0x%x new 0x%x\n",
savefid, data->currfid); savefid, data->currfid);
return 1; return 1;
} }
if (vid != data->currvid) { if (vid != data->currvid) {
printk(KERN_ERR PFX "vid trans failed, vid 0x%x, curr 0x%x\n", vid, printk(KERN_ERR PFX "vid trans failed, vid 0x%x, "
data->currvid); "curr 0x%x\n",
vid, data->currvid);
return 1; return 1;
} }
...@@ -261,7 +274,8 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid) ...@@ -261,7 +274,8 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
* Decreasing vid codes represent increasing voltages: * Decreasing vid codes represent increasing voltages:
* vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of VID_OFF is off. * vid of 0 is 1.550V, vid of 0x1e is 0.800V, vid of VID_OFF is off.
*/ */
static int decrease_vid_code_by_step(struct powernow_k8_data *data, u32 reqvid, u32 step) static int decrease_vid_code_by_step(struct powernow_k8_data *data,
u32 reqvid, u32 step)
{ {
if ((data->currvid - reqvid) > step) if ((data->currvid - reqvid) > step)
reqvid = data->currvid - step; reqvid = data->currvid - step;
...@@ -283,7 +297,8 @@ static int transition_pstate(struct powernow_k8_data *data, u32 pstate) ...@@ -283,7 +297,8 @@ static int transition_pstate(struct powernow_k8_data *data, u32 pstate)
} }
/* Change Opteron/Athlon64 fid and vid, by the 3 phases. */ /* Change Opteron/Athlon64 fid and vid, by the 3 phases. */
static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 reqvid) static int transition_fid_vid(struct powernow_k8_data *data,
u32 reqfid, u32 reqvid)
{ {
if (core_voltage_pre_transition(data, reqvid)) if (core_voltage_pre_transition(data, reqvid))
return 1; return 1;
...@@ -298,7 +313,8 @@ static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 req ...@@ -298,7 +313,8 @@ static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 req
return 1; return 1;
if ((reqfid != data->currfid) || (reqvid != data->currvid)) { if ((reqfid != data->currfid) || (reqvid != data->currvid)) {
printk(KERN_ERR PFX "failed (cpu%d): req 0x%x 0x%x, curr 0x%x 0x%x\n", printk(KERN_ERR PFX "failed (cpu%d): req 0x%x 0x%x, "
"curr 0x%x 0x%x\n",
smp_processor_id(), smp_processor_id(),
reqfid, reqvid, data->currfid, data->currvid); reqfid, reqvid, data->currfid, data->currvid);
return 1; return 1;
...@@ -311,13 +327,15 @@ static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 req ...@@ -311,13 +327,15 @@ static int transition_fid_vid(struct powernow_k8_data *data, u32 reqfid, u32 req
} }
/* Phase 1 - core voltage transition ... setup voltage */ /* Phase 1 - core voltage transition ... setup voltage */
static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid) static int core_voltage_pre_transition(struct powernow_k8_data *data,
u32 reqvid)
{ {
u32 rvosteps = data->rvo; u32 rvosteps = data->rvo;
u32 savefid = data->currfid; u32 savefid = data->currfid;
u32 maxvid, lo; u32 maxvid, lo;
dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n", dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, "
"reqvid 0x%x, rvo 0x%x\n",
smp_processor_id(), smp_processor_id(),
data->currfid, data->currvid, reqvid, data->rvo); data->currfid, data->currvid, reqvid, data->rvo);
...@@ -340,7 +358,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid ...@@ -340,7 +358,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
} else { } else {
dprintk("ph1: changing vid for rvo, req 0x%x\n", dprintk("ph1: changing vid for rvo, req 0x%x\n",
data->currvid - 1); data->currvid - 1);
if (decrease_vid_code_by_step(data, data->currvid - 1, 1)) if (decrease_vid_code_by_step(data, data->currvid-1, 1))
return 1; return 1;
rvosteps--; rvosteps--;
} }
...@@ -350,7 +368,8 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid ...@@ -350,7 +368,8 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
return 1; return 1;
if (savefid != data->currfid) { if (savefid != data->currfid) {
printk(KERN_ERR PFX "ph1 err, currfid changed 0x%x\n", data->currfid); printk(KERN_ERR PFX "ph1 err, currfid changed 0x%x\n",
data->currfid);
return 1; return 1;
} }
...@@ -363,20 +382,24 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid ...@@ -363,20 +382,24 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, u32 reqvid
/* Phase 2 - core frequency transition */ /* Phase 2 - core frequency transition */
static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
{ {
u32 vcoreqfid, vcocurrfid, vcofiddiff, fid_interval, savevid = data->currvid; u32 vcoreqfid, vcocurrfid, vcofiddiff;
u32 fid_interval, savevid = data->currvid;
if ((reqfid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { if ((reqfid < HI_FID_TABLE_BOTTOM) &&
printk(KERN_ERR PFX "ph2: illegal lo-lo transition 0x%x 0x%x\n", (data->currfid < HI_FID_TABLE_BOTTOM)) {
reqfid, data->currfid); printk(KERN_ERR PFX "ph2: illegal lo-lo transition "
"0x%x 0x%x\n", reqfid, data->currfid);
return 1; return 1;
} }
if (data->currfid == reqfid) { if (data->currfid == reqfid) {
printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n", data->currfid); printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n",
data->currfid);
return 0; return 0;
} }
dprintk("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, reqfid 0x%x\n", dprintk("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, "
"reqfid 0x%x\n",
smp_processor_id(), smp_processor_id(),
data->currfid, data->currvid, reqfid); data->currfid, data->currvid, reqfid);
...@@ -390,15 +413,15 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) ...@@ -390,15 +413,15 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
if (reqfid > data->currfid) { if (reqfid > data->currfid) {
if (data->currfid > LO_FID_TABLE_TOP) { if (data->currfid > LO_FID_TABLE_TOP) {
if (write_new_fid(data, data->currfid + fid_interval)) { if (write_new_fid(data,
data->currfid + fid_interval))
return 1; return 1;
}
} else { } else {
if (write_new_fid if (write_new_fid
(data, 2 + convert_fid_to_vco_fid(data->currfid))) { (data,
2 + convert_fid_to_vco_fid(data->currfid)))
return 1; return 1;
} }
}
} else { } else {
if (write_new_fid(data, data->currfid - fid_interval)) if (write_new_fid(data, data->currfid - fid_interval))
return 1; return 1;
...@@ -417,7 +440,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) ...@@ -417,7 +440,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
if (data->currfid != reqfid) { if (data->currfid != reqfid) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
"ph2: mismatch, failed fid transition, curr 0x%x, req 0x%x\n", "ph2: mismatch, failed fid transition, "
"curr 0x%x, req 0x%x\n",
data->currfid, reqfid); data->currfid, reqfid);
return 1; return 1;
} }
...@@ -435,7 +459,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid) ...@@ -435,7 +459,8 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
} }
/* Phase 3 - core voltage transition flow ... jump to the final vid. */ /* Phase 3 - core voltage transition flow ... jump to the final vid. */
static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid) static int core_voltage_post_transition(struct powernow_k8_data *data,
u32 reqvid)
{ {
u32 savefid = data->currfid; u32 savefid = data->currfid;
u32 savereqvid = reqvid; u32 savereqvid = reqvid;
...@@ -457,7 +482,8 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi ...@@ -457,7 +482,8 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi
if (data->currvid != reqvid) { if (data->currvid != reqvid) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
"ph3: failed vid transition\n, req 0x%x, curr 0x%x", "ph3: failed vid transition\n, "
"req 0x%x, curr 0x%x",
reqvid, data->currvid); reqvid, data->currvid);
return 1; return 1;
} }
...@@ -508,7 +534,8 @@ static int check_supported_cpu(unsigned int cpu) ...@@ -508,7 +534,8 @@ static int check_supported_cpu(unsigned int cpu)
if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) { if ((eax & CPUID_XFAM) == CPUID_XFAM_K8) {
if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) || if (((eax & CPUID_USE_XFAM_XMOD) != CPUID_USE_XFAM_XMOD) ||
((eax & CPUID_XMOD) > CPUID_XMOD_REV_MASK)) { ((eax & CPUID_XMOD) > CPUID_XMOD_REV_MASK)) {
printk(KERN_INFO PFX "Processor cpuid %x not supported\n", eax); printk(KERN_INFO PFX
"Processor cpuid %x not supported\n", eax);
goto out; goto out;
} }
...@@ -520,8 +547,10 @@ static int check_supported_cpu(unsigned int cpu) ...@@ -520,8 +547,10 @@ static int check_supported_cpu(unsigned int cpu)
} }
cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx); cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
if ((edx & P_STATE_TRANSITION_CAPABLE) != P_STATE_TRANSITION_CAPABLE) { if ((edx & P_STATE_TRANSITION_CAPABLE)
printk(KERN_INFO PFX "Power state transitions not supported\n"); != P_STATE_TRANSITION_CAPABLE) {
printk(KERN_INFO PFX
"Power state transitions not supported\n");
goto out; goto out;
} }
} else { /* must be a HW Pstate capable processor */ } else { /* must be a HW Pstate capable processor */
...@@ -539,7 +568,8 @@ static int check_supported_cpu(unsigned int cpu) ...@@ -539,7 +568,8 @@ static int check_supported_cpu(unsigned int cpu)
return rc; return rc;
} }
static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid) static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst,
u8 maxvid)
{ {
unsigned int j; unsigned int j;
u8 lastfid = 0xff; u8 lastfid = 0xff;
...@@ -550,12 +580,14 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 ...@@ -550,12 +580,14 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8
j, pst[j].vid); j, pst[j].vid);
return -EINVAL; return -EINVAL;
} }
if (pst[j].vid < data->rvo) { /* vid + rvo >= 0 */ if (pst[j].vid < data->rvo) {
/* vid + rvo >= 0 */
printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate" printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate"
" %d\n", j); " %d\n", j);
return -ENODEV; return -ENODEV;
} }
if (pst[j].vid < maxvid + data->rvo) { /* vid + rvo >= maxvid */ if (pst[j].vid < maxvid + data->rvo) {
/* vid + rvo >= maxvid */
printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate" printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate"
" %d\n", j); " %d\n", j);
return -ENODEV; return -ENODEV;
...@@ -579,23 +611,31 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 ...@@ -579,23 +611,31 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8
return -EINVAL; return -EINVAL;
} }
if (lastfid > LO_FID_TABLE_TOP) if (lastfid > LO_FID_TABLE_TOP)
printk(KERN_INFO FW_BUG PFX "first fid not from lo freq table\n"); printk(KERN_INFO FW_BUG PFX
"first fid not from lo freq table\n");
return 0; return 0;
} }
static void invalidate_entry(struct powernow_k8_data *data, unsigned int entry)
{
data->powernow_table[entry].frequency = CPUFREQ_ENTRY_INVALID;
}
static void print_basics(struct powernow_k8_data *data) static void print_basics(struct powernow_k8_data *data)
{ {
int j; int j;
for (j = 0; j < data->numps; j++) { for (j = 0; j < data->numps; j++) {
if (data->powernow_table[j].frequency != CPUFREQ_ENTRY_INVALID) { if (data->powernow_table[j].frequency !=
CPUFREQ_ENTRY_INVALID) {
if (cpu_family == CPU_HW_PSTATE) { if (cpu_family == CPU_HW_PSTATE) {
printk(KERN_INFO PFX " %d : pstate %d (%d MHz)\n", printk(KERN_INFO PFX
j, " %d : pstate %d (%d MHz)\n", j,
data->powernow_table[j].index, data->powernow_table[j].index,
data->powernow_table[j].frequency/1000); data->powernow_table[j].frequency/1000);
} else { } else {
printk(KERN_INFO PFX " %d : fid 0x%x (%d MHz), vid 0x%x\n", printk(KERN_INFO PFX
" %d : fid 0x%x (%d MHz), vid 0x%x\n",
j, j,
data->powernow_table[j].index & 0xff, data->powernow_table[j].index & 0xff,
data->powernow_table[j].frequency/1000, data->powernow_table[j].frequency/1000,
...@@ -604,20 +644,25 @@ static void print_basics(struct powernow_k8_data *data) ...@@ -604,20 +644,25 @@ static void print_basics(struct powernow_k8_data *data)
} }
} }
if (data->batps) if (data->batps)
printk(KERN_INFO PFX "Only %d pstates on battery\n", data->batps); printk(KERN_INFO PFX "Only %d pstates on battery\n",
data->batps);
} }
static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst, u8 maxvid) static int fill_powernow_table(struct powernow_k8_data *data,
struct pst_s *pst, u8 maxvid)
{ {
struct cpufreq_frequency_table *powernow_table; struct cpufreq_frequency_table *powernow_table;
unsigned int j; unsigned int j;
if (data->batps) { /* use ACPI support to get full speed on mains power */ if (data->batps) {
printk(KERN_WARNING PFX "Only %d pstates usable (use ACPI driver for full range\n", data->batps); /* use ACPI support to get full speed on mains power */
printk(KERN_WARNING PFX
"Only %d pstates usable (use ACPI driver for full "
"range\n", data->batps);
data->numps = data->batps; data->numps = data->batps;
} }
for ( j=1; j<data->numps; j++ ) { for (j = 1; j < data->numps; j++) {
if (pst[j-1].fid >= pst[j].fid) { if (pst[j-1].fid >= pst[j].fid) {
printk(KERN_ERR PFX "PST out of sequence\n"); printk(KERN_ERR PFX "PST out of sequence\n");
return -EINVAL; return -EINVAL;
...@@ -640,9 +685,11 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst, ...@@ -640,9 +685,11 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst,
} }
for (j = 0; j < data->numps; j++) { for (j = 0; j < data->numps; j++) {
int freq;
powernow_table[j].index = pst[j].fid; /* lower 8 bits */ powernow_table[j].index = pst[j].fid; /* lower 8 bits */
powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */ powernow_table[j].index |= (pst[j].vid << 8); /* upper 8 bits */
powernow_table[j].frequency = find_khz_freq_from_fid(pst[j].fid); freq = find_khz_freq_from_fid(pst[j].fid);
powernow_table[j].frequency = freq;
} }
powernow_table[data->numps].frequency = CPUFREQ_TABLE_END; powernow_table[data->numps].frequency = CPUFREQ_TABLE_END;
powernow_table[data->numps].index = 0; powernow_table[data->numps].index = 0;
...@@ -658,7 +705,8 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst, ...@@ -658,7 +705,8 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst,
print_basics(data); print_basics(data);
for (j = 0; j < data->numps; j++) for (j = 0; j < data->numps; j++)
if ((pst[j].fid==data->currfid) && (pst[j].vid==data->currvid)) if ((pst[j].fid == data->currfid) &&
(pst[j].vid == data->currvid))
return 0; return 0;
dprintk("currfid/vid do not match PST, ignoring\n"); dprintk("currfid/vid do not match PST, ignoring\n");
...@@ -698,7 +746,8 @@ static int find_psb_table(struct powernow_k8_data *data) ...@@ -698,7 +746,8 @@ static int find_psb_table(struct powernow_k8_data *data)
} }
data->vstable = psb->vstable; data->vstable = psb->vstable;
dprintk("voltage stabilization time: %d(*20us)\n", data->vstable); dprintk("voltage stabilization time: %d(*20us)\n",
data->vstable);
dprintk("flags2: 0x%x\n", psb->flags2); dprintk("flags2: 0x%x\n", psb->flags2);
data->rvo = psb->flags2 & 3; data->rvo = psb->flags2 & 3;
...@@ -713,12 +762,13 @@ static int find_psb_table(struct powernow_k8_data *data) ...@@ -713,12 +762,13 @@ static int find_psb_table(struct powernow_k8_data *data)
dprintk("numpst: 0x%x\n", psb->num_tables); dprintk("numpst: 0x%x\n", psb->num_tables);
cpst = psb->num_tables; cpst = psb->num_tables;
if ((psb->cpuid == 0x00000fc0) || (psb->cpuid == 0x00000fe0) ){ if ((psb->cpuid == 0x00000fc0) ||
(psb->cpuid == 0x00000fe0)) {
thiscpuid = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); thiscpuid = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
if ((thiscpuid == 0x00000fc0) || (thiscpuid == 0x00000fe0) ) { if ((thiscpuid == 0x00000fc0) ||
(thiscpuid == 0x00000fe0))
cpst = 1; cpst = 1;
} }
}
if (cpst != 1) { if (cpst != 1) {
printk(KERN_ERR FW_BUG PFX "numpst must be 1\n"); printk(KERN_ERR FW_BUG PFX "numpst must be 1\n");
return -ENODEV; return -ENODEV;
...@@ -732,7 +782,8 @@ static int find_psb_table(struct powernow_k8_data *data) ...@@ -732,7 +782,8 @@ static int find_psb_table(struct powernow_k8_data *data)
data->numps = psb->numps; data->numps = psb->numps;
dprintk("numpstates: 0x%x\n", data->numps); dprintk("numpstates: 0x%x\n", data->numps);
return fill_powernow_table(data, (struct pst_s *)(psb+1), maxvid); return fill_powernow_table(data,
(struct pst_s *)(psb+1), maxvid);
} }
/* /*
* If you see this message, complain to BIOS manufacturer. If * If you see this message, complain to BIOS manufacturer. If
...@@ -750,23 +801,27 @@ static int find_psb_table(struct powernow_k8_data *data) ...@@ -750,23 +801,27 @@ static int find_psb_table(struct powernow_k8_data *data)
} }
#ifdef CONFIG_X86_POWERNOW_K8_ACPI #ifdef CONFIG_X86_POWERNOW_K8_ACPI
static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data,
unsigned int index)
{ {
acpi_integer control;
if (!data->acpi_data.state_count || (cpu_family == CPU_HW_PSTATE)) if (!data->acpi_data.state_count || (cpu_family == CPU_HW_PSTATE))
return; return;
data->irt = (data->acpi_data.states[index].control >> IRT_SHIFT) & IRT_MASK; control = data->acpi_data.states[index].control; data->irt = (control
data->rvo = (data->acpi_data.states[index].control >> RVO_SHIFT) & RVO_MASK; >> IRT_SHIFT) & IRT_MASK; data->rvo = (control >>
data->exttype = (data->acpi_data.states[index].control >> EXT_TYPE_SHIFT) & EXT_TYPE_MASK; RVO_SHIFT) & RVO_MASK; data->exttype = (control
data->plllock = (data->acpi_data.states[index].control >> PLL_L_SHIFT) & PLL_L_MASK; >> EXT_TYPE_SHIFT) & EXT_TYPE_MASK;
data->vidmvs = 1 << ((data->acpi_data.states[index].control >> MVS_SHIFT) & MVS_MASK); data->plllock = (control >> PLL_L_SHIFT) & PLL_L_MASK; data->vidmvs = 1
data->vstable = (data->acpi_data.states[index].control >> VST_SHIFT) & VST_MASK; << ((control >> MVS_SHIFT) & MVS_MASK); data->vstable =
} (control >> VST_SHIFT) & VST_MASK; }
static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
{ {
struct cpufreq_frequency_table *powernow_table; struct cpufreq_frequency_table *powernow_table;
int ret_val = -ENODEV; int ret_val = -ENODEV;
acpi_integer space_id;
if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) { if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {
dprintk("register performance failed: bad ACPI data\n"); dprintk("register performance failed: bad ACPI data\n");
...@@ -779,11 +834,12 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) ...@@ -779,11 +834,12 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
goto err_out; goto err_out;
} }
if ((data->acpi_data.control_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) || space_id = data->acpi_data.control_register.space_id;
(data->acpi_data.status_register.space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) { if ((space_id != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
(space_id != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
dprintk("Invalid control/status registers (%x - %x)\n", dprintk("Invalid control/status registers (%x - %x)\n",
data->acpi_data.control_register.space_id, data->acpi_data.control_register.space_id,
data->acpi_data.status_register.space_id); space_id);
goto err_out; goto err_out;
} }
...@@ -802,7 +858,8 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) ...@@ -802,7 +858,8 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
if (ret_val) if (ret_val)
goto err_out_mem; goto err_out_mem;
powernow_table[data->acpi_data.state_count].frequency = CPUFREQ_TABLE_END; powernow_table[data->acpi_data.state_count].frequency =
CPUFREQ_TABLE_END;
powernow_table[data->acpi_data.state_count].index = 0; powernow_table[data->acpi_data.state_count].index = 0;
data->powernow_table = powernow_table; data->powernow_table = powernow_table;
...@@ -830,13 +887,15 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) ...@@ -830,13 +887,15 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
err_out: err_out:
acpi_processor_unregister_performance(&data->acpi_data, data->cpu); acpi_processor_unregister_performance(&data->acpi_data, data->cpu);
/* data->acpi_data.state_count informs us at ->exit() whether ACPI was used */ /* data->acpi_data.state_count informs us at ->exit()
* whether ACPI was used */
data->acpi_data.state_count = 0; data->acpi_data.state_count = 0;
return ret_val; return ret_val;
} }
static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table) static int fill_powernow_table_pstate(struct powernow_k8_data *data,
struct cpufreq_frequency_table *powernow_table)
{ {
int i; int i;
u32 hi = 0, lo = 0; u32 hi = 0, lo = 0;
...@@ -848,84 +907,101 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpuf ...@@ -848,84 +907,101 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpuf
index = data->acpi_data.states[i].control & HW_PSTATE_MASK; index = data->acpi_data.states[i].control & HW_PSTATE_MASK;
if (index > data->max_hw_pstate) { if (index > data->max_hw_pstate) {
printk(KERN_ERR PFX "invalid pstate %d - bad value %d.\n", i, index); printk(KERN_ERR PFX "invalid pstate %d - "
printk(KERN_ERR PFX "Please report to BIOS manufacturer\n"); "bad value %d.\n", i, index);
powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; printk(KERN_ERR PFX "Please report to BIOS "
"manufacturer\n");
invalidate_entry(data, i);
continue; continue;
} }
rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi); rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
if (!(hi & HW_PSTATE_VALID_MASK)) { if (!(hi & HW_PSTATE_VALID_MASK)) {
dprintk("invalid pstate %d, ignoring\n", index); dprintk("invalid pstate %d, ignoring\n", index);
powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; invalidate_entry(data, i);
continue; continue;
} }
powernow_table[i].index = index; powernow_table[i].index = index;
powernow_table[i].frequency = data->acpi_data.states[i].core_frequency * 1000; powernow_table[i].frequency =
data->acpi_data.states[i].core_frequency * 1000;
} }
return 0; return 0;
} }
static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table) static int fill_powernow_table_fidvid(struct powernow_k8_data *data,
struct cpufreq_frequency_table *powernow_table)
{ {
int i; int i;
int cntlofreq = 0; int cntlofreq = 0;
for (i = 0; i < data->acpi_data.state_count; i++) { for (i = 0; i < data->acpi_data.state_count; i++) {
u32 fid; u32 fid;
u32 vid; u32 vid;
u32 freq, index;
acpi_integer status, control;
if (data->exttype) { if (data->exttype) {
fid = data->acpi_data.states[i].status & EXT_FID_MASK; status = data->acpi_data.states[i].status;
vid = (data->acpi_data.states[i].status >> VID_SHIFT) & EXT_VID_MASK; fid = status & EXT_FID_MASK;
vid = (status >> VID_SHIFT) & EXT_VID_MASK;
} else { } else {
fid = data->acpi_data.states[i].control & FID_MASK; control = data->acpi_data.states[i].control;
vid = (data->acpi_data.states[i].control >> VID_SHIFT) & VID_MASK; fid = control & FID_MASK;
vid = (control >> VID_SHIFT) & VID_MASK;
} }
dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
powernow_table[i].index = fid; /* lower 8 bits */ index = fid | (vid<<8);
powernow_table[i].index |= (vid << 8); /* upper 8 bits */ powernow_table[i].index = index;
powernow_table[i].frequency = find_khz_freq_from_fid(fid);
freq = find_khz_freq_from_fid(fid);
powernow_table[i].frequency = freq;
/* verify frequency is OK */ /* verify frequency is OK */
if ((powernow_table[i].frequency > (MAX_FREQ * 1000)) || if ((freq > (MAX_FREQ * 1000)) || (freq < (MIN_FREQ * 1000))) {
(powernow_table[i].frequency < (MIN_FREQ * 1000))) { dprintk("invalid freq %u kHz, ignoring\n", freq);
dprintk("invalid freq %u kHz, ignoring\n", powernow_table[i].frequency); invalidate_entry(data, i);
powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;
continue; continue;
} }
/* verify voltage is OK - BIOSs are using "off" to indicate invalid */ /* verify voltage is OK -
* BIOSs are using "off" to indicate invalid */
if (vid == VID_OFF) { if (vid == VID_OFF) {
dprintk("invalid vid %u, ignoring\n", vid); dprintk("invalid vid %u, ignoring\n", vid);
powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; invalidate_entry(data, i);
continue; continue;
} }
/* verify only 1 entry from the lo frequency table */ /* verify only 1 entry from the lo frequency table */
if (fid < HI_FID_TABLE_BOTTOM) { if (fid < HI_FID_TABLE_BOTTOM) {
if (cntlofreq) { if (cntlofreq) {
/* if both entries are the same, ignore this one ... */ /* if both entries are the same,
if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) || * ignore this one ... */
(powernow_table[i].index != powernow_table[cntlofreq].index)) { if ((freq != powernow_table[cntlofreq].frequency) ||
printk(KERN_ERR PFX "Too many lo freq table entries\n"); (index != powernow_table[cntlofreq].index)) {
printk(KERN_ERR PFX
"Too many lo freq table "
"entries\n");
return 1; return 1;
} }
dprintk("double low frequency table entry, ignoring it.\n"); dprintk("double low frequency table entry, "
powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; "ignoring it.\n");
invalidate_entry(data, i);
continue; continue;
} else } else
cntlofreq = i; cntlofreq = i;
} }
if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) { if (freq != (data->acpi_data.states[i].core_frequency * 1000)) {
printk(KERN_INFO PFX "invalid freq entries %u kHz vs. %u kHz\n", printk(KERN_INFO PFX "invalid freq entries "
powernow_table[i].frequency, "%u kHz vs. %u kHz\n", freq,
(unsigned int) (data->acpi_data.states[i].core_frequency * 1000)); (unsigned int)
powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID; (data->acpi_data.states[i].core_frequency
* 1000));
invalidate_entry(data, i);
continue; continue;
} }
} }
...@@ -935,7 +1011,8 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpuf ...@@ -935,7 +1011,8 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data, struct cpuf
static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data)
{ {
if (data->acpi_data.state_count) if (data->acpi_data.state_count)
acpi_processor_unregister_performance(&data->acpi_data, data->cpu); acpi_processor_unregister_performance(&data->acpi_data,
data->cpu);
free_cpumask_var(data->acpi_data.shared_cpu_map); free_cpumask_var(data->acpi_data.shared_cpu_map);
} }
...@@ -954,14 +1031,25 @@ static int get_transition_latency(struct powernow_k8_data *data) ...@@ -954,14 +1031,25 @@ static int get_transition_latency(struct powernow_k8_data *data)
} }
#else #else
static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) { return -ENODEV; } static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) { return; } {
static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) { return; } return -ENODEV;
}
static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data)
{
return;
}
static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data,
unsigned int index)
{
return;
}
static int get_transition_latency(struct powernow_k8_data *data) { return 0; } static int get_transition_latency(struct powernow_k8_data *data) { return 0; }
#endif /* CONFIG_X86_POWERNOW_K8_ACPI */ #endif /* CONFIG_X86_POWERNOW_K8_ACPI */
/* Take a frequency, and issue the fid/vid transition command */ /* Take a frequency, and issue the fid/vid transition command */
static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned int index) static int transition_frequency_fidvid(struct powernow_k8_data *data,
unsigned int index)
{ {
u32 fid = 0; u32 fid = 0;
u32 vid = 0; u32 vid = 0;
...@@ -989,7 +1077,8 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i ...@@ -989,7 +1077,8 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i
return 0; return 0;
} }
if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) { if ((fid < HI_FID_TABLE_BOTTOM) &&
(data->currfid < HI_FID_TABLE_BOTTOM)) {
printk(KERN_ERR PFX printk(KERN_ERR PFX
"ignoring illegal change in lo freq table-%x to 0x%x\n", "ignoring illegal change in lo freq table-%x to 0x%x\n",
data->currfid, fid); data->currfid, fid);
...@@ -1017,7 +1106,8 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i ...@@ -1017,7 +1106,8 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, unsigned i
} }
/* Take a frequency, and issue the hardware pstate transition command */ /* Take a frequency, and issue the hardware pstate transition command */
static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned int index) static int transition_frequency_pstate(struct powernow_k8_data *data,
unsigned int index)
{ {
u32 pstate = 0; u32 pstate = 0;
int res, i; int res, i;
...@@ -1029,7 +1119,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i ...@@ -1029,7 +1119,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
pstate = index & HW_PSTATE_MASK; pstate = index & HW_PSTATE_MASK;
if (pstate > data->max_hw_pstate) if (pstate > data->max_hw_pstate)
return 0; return 0;
freqs.old = find_khz_freq_from_pstate(data->powernow_table, data->currpstate); freqs.old = find_khz_freq_from_pstate(data->powernow_table,
data->currpstate);
freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate); freqs.new = find_khz_freq_from_pstate(data->powernow_table, pstate);
for_each_cpu_mask_nr(i, *(data->available_cores)) { for_each_cpu_mask_nr(i, *(data->available_cores)) {
...@@ -1048,7 +1139,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i ...@@ -1048,7 +1139,8 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i
} }
/* Driver entry point to switch to the target frequency */ /* Driver entry point to switch to the target frequency */
static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) static int powernowk8_target(struct cpufreq_policy *pol,
unsigned targfreq, unsigned relation)
{ {
cpumask_t oldmask; cpumask_t oldmask;
struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
...@@ -1087,14 +1179,18 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi ...@@ -1087,14 +1179,18 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
dprintk("targ: curr fid 0x%x, vid 0x%x\n", dprintk("targ: curr fid 0x%x, vid 0x%x\n",
data->currfid, data->currvid); data->currfid, data->currvid);
if ((checkvid != data->currvid) || (checkfid != data->currfid)) { if ((checkvid != data->currvid) ||
(checkfid != data->currfid)) {
printk(KERN_INFO PFX printk(KERN_INFO PFX
"error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n", "error - out of sync, fix 0x%x 0x%x, "
checkfid, data->currfid, checkvid, data->currvid); "vid 0x%x 0x%x\n",
checkfid, data->currfid,
checkvid, data->currvid);
} }
} }
if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate)) if (cpufreq_frequency_table_target(pol, data->powernow_table,
targfreq, relation, &newstate))
goto err_out; goto err_out;
mutex_lock(&fidvid_mutex); mutex_lock(&fidvid_mutex);
...@@ -1114,7 +1210,8 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi ...@@ -1114,7 +1210,8 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
mutex_unlock(&fidvid_mutex); mutex_unlock(&fidvid_mutex);
if (cpu_family == CPU_HW_PSTATE) if (cpu_family == CPU_HW_PSTATE)
pol->cur = find_khz_freq_from_pstate(data->powernow_table, newstate); pol->cur = find_khz_freq_from_pstate(data->powernow_table,
newstate);
else else
pol->cur = find_khz_freq_from_fid(data->currfid); pol->cur = find_khz_freq_from_fid(data->currfid);
ret = 0; ret = 0;
...@@ -1164,8 +1261,9 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1164,8 +1261,9 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
*/ */
if (num_online_cpus() != 1) { if (num_online_cpus() != 1) {
#ifndef CONFIG_ACPI_PROCESSOR #ifndef CONFIG_ACPI_PROCESSOR
printk(KERN_ERR PFX "ACPI Processor support is required " printk(KERN_ERR PFX
"for SMP systems but is absent. Please load the " "ACPI Processor support is required for "
"SMP systems but is absent. Please load the "
"ACPI Processor module before starting this " "ACPI Processor module before starting this "
"driver.\n"); "driver.\n");
#else #else
...@@ -1228,7 +1326,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1228,7 +1326,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
data->available_cores = pol->cpus; data->available_cores = pol->cpus;
if (cpu_family == CPU_HW_PSTATE) if (cpu_family == CPU_HW_PSTATE)
pol->cur = find_khz_freq_from_pstate(data->powernow_table, data->currpstate); pol->cur = find_khz_freq_from_pstate(data->powernow_table,
data->currpstate);
else else
pol->cur = find_khz_freq_from_fid(data->currfid); pol->cur = find_khz_freq_from_fid(data->currfid);
dprintk("policy current frequency %d kHz\n", pol->cur); dprintk("policy current frequency %d kHz\n", pol->cur);
...@@ -1245,7 +1344,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1245,7 +1344,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu); cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu);
if (cpu_family == CPU_HW_PSTATE) if (cpu_family == CPU_HW_PSTATE)
dprintk("cpu_init done, current pstate 0x%x\n", data->currpstate); dprintk("cpu_init done, current pstate 0x%x\n",
data->currpstate);
else else
dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n", dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n",
data->currfid, data->currvid); data->currfid, data->currvid);
...@@ -1262,7 +1362,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1262,7 +1362,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
return -ENODEV; return -ENODEV;
} }
static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol) static int __devexit powernowk8_cpu_exit(struct cpufreq_policy *pol)
{ {
struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
...@@ -1279,7 +1379,7 @@ static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol) ...@@ -1279,7 +1379,7 @@ static int __devexit powernowk8_cpu_exit (struct cpufreq_policy *pol)
return 0; return 0;
} }
static unsigned int powernowk8_get (unsigned int cpu) static unsigned int powernowk8_get(unsigned int cpu)
{ {
struct powernow_k8_data *data; struct powernow_k8_data *data;
cpumask_t oldmask = current->cpus_allowed; cpumask_t oldmask = current->cpus_allowed;
...@@ -1315,7 +1415,7 @@ static unsigned int powernowk8_get (unsigned int cpu) ...@@ -1315,7 +1415,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
return khz; return khz;
} }
static struct freq_attr* powernow_k8_attr[] = { static struct freq_attr *powernow_k8_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs, &cpufreq_freq_attr_scaling_available_freqs,
NULL, NULL,
}; };
...@@ -1360,7 +1460,8 @@ static void __exit powernowk8_exit(void) ...@@ -1360,7 +1460,8 @@ static void __exit powernowk8_exit(void)
cpufreq_unregister_driver(&cpufreq_amd64_driver); cpufreq_unregister_driver(&cpufreq_amd64_driver);
} }
MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com>"); MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and "
"Mark Langsdorf <mark.langsdorf@amd.com>");
MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver."); MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
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