cpufreq: powernow-k8: Suppress checkpatch warnings
Suppress the following checkpatch.pl warnings: - WARNING: Prefer pr_err(... to printk(KERN_ERR ... - WARNING: Prefer pr_info(... to printk(KERN_INFO ... - WARNING: Prefer pr_warn(... to printk(KERN_WARNING ... - WARNING: quoted string split across lines - WARNING: please, no spaces at the start of a line Also, define the pr_fmt macro instead of PFX for the module name. Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
60d1ea4e0a
commit
e54173b4ed
|
@ -27,6 +27,8 @@
|
||||||
* power and thermal data sheets, (e.g. 30417.pdf, 30430.pdf, 43375.pdf)
|
* power and thermal data sheets, (e.g. 30417.pdf, 30430.pdf, 43375.pdf)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/smp.h>
|
#include <linux/smp.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
@ -45,7 +47,6 @@
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <acpi/processor.h>
|
#include <acpi/processor.h>
|
||||||
|
|
||||||
#define PFX "powernow-k8: "
|
|
||||||
#define VERSION "version 2.20.00"
|
#define VERSION "version 2.20.00"
|
||||||
#include "powernow-k8.h"
|
#include "powernow-k8.h"
|
||||||
|
|
||||||
|
@ -161,7 +162,7 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
|
|
||||||
if ((fid & INVALID_FID_MASK) || (data->currvid & INVALID_VID_MASK)) {
|
if ((fid & INVALID_FID_MASK) || (data->currvid & INVALID_VID_MASK)) {
|
||||||
printk(KERN_ERR PFX "internal error - overflow on fid write\n");
|
pr_err("internal error - overflow on fid write\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,9 +176,7 @@ 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
|
pr_err("Hardware error - pending bit very stuck - no further pstate changes possible\n");
|
||||||
"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));
|
||||||
|
@ -185,15 +184,13 @@ 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
|
pr_err("vid change on fid trans, old 0x%x, new 0x%x\n",
|
||||||
"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
|
pr_err("fid trans failed, fid 0x%x, curr 0x%x\n", fid,
|
||||||
"fid trans failed, fid 0x%x, curr 0x%x\n", fid,
|
|
||||||
data->currfid);
|
data->currfid);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -209,7 +206,7 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
if ((data->currfid & INVALID_FID_MASK) || (vid & INVALID_VID_MASK)) {
|
if ((data->currfid & INVALID_FID_MASK) || (vid & INVALID_VID_MASK)) {
|
||||||
printk(KERN_ERR PFX "internal error - overflow on vid write\n");
|
pr_err("internal error - overflow on vid write\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,23 +220,19 @@ 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 "
|
pr_err("internal error - pending bit very stuck - no further pstate changes possible\n");
|
||||||
"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 "
|
pr_err("fid changed on vid trans, old 0x%x new 0x%x\n",
|
||||||
"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, "
|
pr_err("vid trans failed, vid 0x%x, curr 0x%x\n",
|
||||||
"curr 0x%x\n",
|
|
||||||
vid, data->currvid);
|
vid, data->currvid);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -283,8 +276,7 @@ static int transition_fid_vid(struct powernow_k8_data *data,
|
||||||
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, "
|
pr_err("failed (cpu%d): req 0x%x 0x%x, curr 0x%x 0x%x\n",
|
||||||
"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;
|
||||||
|
@ -304,8 +296,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
|
||||||
u32 savefid = data->currfid;
|
u32 savefid = data->currfid;
|
||||||
u32 maxvid, lo, rvomult = 1;
|
u32 maxvid, lo, rvomult = 1;
|
||||||
|
|
||||||
pr_debug("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, "
|
pr_debug("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",
|
||||||
"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);
|
||||||
|
|
||||||
|
@ -342,8 +333,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (savefid != data->currfid) {
|
if (savefid != data->currfid) {
|
||||||
printk(KERN_ERR PFX "ph1 err, currfid changed 0x%x\n",
|
pr_err("ph1 err, currfid changed 0x%x\n", data->currfid);
|
||||||
data->currfid);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,13 +350,11 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
|
||||||
u32 fid_interval, savevid = data->currvid;
|
u32 fid_interval, savevid = data->currvid;
|
||||||
|
|
||||||
if (data->currfid == reqfid) {
|
if (data->currfid == reqfid) {
|
||||||
printk(KERN_ERR PFX "ph2 null fid transition 0x%x\n",
|
pr_err("ph2 null fid transition 0x%x\n", data->currfid);
|
||||||
data->currfid);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_debug("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, "
|
pr_debug("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, reqfid 0x%x\n",
|
||||||
"reqfid 0x%x\n",
|
|
||||||
smp_processor_id(),
|
smp_processor_id(),
|
||||||
data->currfid, data->currvid, reqfid);
|
data->currfid, data->currvid, reqfid);
|
||||||
|
|
||||||
|
@ -409,15 +397,13 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (data->currfid != reqfid) {
|
if (data->currfid != reqfid) {
|
||||||
printk(KERN_ERR PFX
|
pr_err("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;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (savevid != data->currvid) {
|
if (savevid != data->currvid) {
|
||||||
printk(KERN_ERR PFX "ph2: vid changed, save 0x%x, curr 0x%x\n",
|
pr_err("ph2: vid changed, save 0x%x, curr 0x%x\n",
|
||||||
savevid, data->currvid);
|
savevid, data->currvid);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -444,17 +430,14 @@ static int core_voltage_post_transition(struct powernow_k8_data *data,
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (savefid != data->currfid) {
|
if (savefid != data->currfid) {
|
||||||
printk(KERN_ERR PFX
|
pr_err("ph3: bad fid change, save 0x%x, curr 0x%x\n",
|
||||||
"ph3: bad fid change, save 0x%x, curr 0x%x\n",
|
savefid, data->currfid);
|
||||||
savefid, data->currfid);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->currvid != reqvid) {
|
if (data->currvid != reqvid) {
|
||||||
printk(KERN_ERR PFX
|
pr_err("ph3: failed vid transition\n, req 0x%x, curr 0x%x",
|
||||||
"ph3: failed vid transition\n, "
|
reqvid, data->currvid);
|
||||||
"req 0x%x, curr 0x%x",
|
|
||||||
reqvid, data->currvid);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -498,23 +481,20 @@ static void check_supported_cpu(void *_rc)
|
||||||
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
|
pr_info("Processor cpuid %x not supported\n", eax);
|
||||||
"Processor cpuid %x not supported\n", eax);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
eax = cpuid_eax(CPUID_GET_MAX_CAPABILITIES);
|
eax = cpuid_eax(CPUID_GET_MAX_CAPABILITIES);
|
||||||
if (eax < CPUID_FREQ_VOLT_CAPABILITIES) {
|
if (eax < CPUID_FREQ_VOLT_CAPABILITIES) {
|
||||||
printk(KERN_INFO PFX
|
pr_info("No frequency change capabilities detected\n");
|
||||||
"No frequency change capabilities detected\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
|
cpuid(CPUID_FREQ_VOLT_CAPABILITIES, &eax, &ebx, &ecx, &edx);
|
||||||
if ((edx & P_STATE_TRANSITION_CAPABLE)
|
if ((edx & P_STATE_TRANSITION_CAPABLE)
|
||||||
!= P_STATE_TRANSITION_CAPABLE) {
|
!= P_STATE_TRANSITION_CAPABLE) {
|
||||||
printk(KERN_INFO PFX
|
pr_info("Power state transitions not supported\n");
|
||||||
"Power state transitions not supported\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*rc = 0;
|
*rc = 0;
|
||||||
|
@ -529,43 +509,39 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst,
|
||||||
|
|
||||||
for (j = 0; j < data->numps; j++) {
|
for (j = 0; j < data->numps; j++) {
|
||||||
if (pst[j].vid > LEAST_VID) {
|
if (pst[j].vid > LEAST_VID) {
|
||||||
printk(KERN_ERR FW_BUG PFX "vid %d invalid : 0x%x\n",
|
pr_err(FW_BUG "vid %d invalid : 0x%x\n", j,
|
||||||
j, pst[j].vid);
|
pst[j].vid);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (pst[j].vid < data->rvo) {
|
if (pst[j].vid < data->rvo) {
|
||||||
/* vid + rvo >= 0 */
|
/* vid + rvo >= 0 */
|
||||||
printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate"
|
pr_err(FW_BUG "0 vid exceeded with pstate %d\n", j);
|
||||||
" %d\n", j);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
if (pst[j].vid < maxvid + data->rvo) {
|
if (pst[j].vid < maxvid + data->rvo) {
|
||||||
/* vid + rvo >= maxvid */
|
/* vid + rvo >= maxvid */
|
||||||
printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate"
|
pr_err(FW_BUG "maxvid exceeded with pstate %d\n", j);
|
||||||
" %d\n", j);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
if (pst[j].fid > MAX_FID) {
|
if (pst[j].fid > MAX_FID) {
|
||||||
printk(KERN_ERR FW_BUG PFX "maxfid exceeded with pstate"
|
pr_err(FW_BUG "maxfid exceeded with pstate %d\n", j);
|
||||||
" %d\n", j);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) {
|
if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) {
|
||||||
/* Only first fid is allowed to be in "low" range */
|
/* Only first fid is allowed to be in "low" range */
|
||||||
printk(KERN_ERR FW_BUG PFX "two low fids - %d : "
|
pr_err(FW_BUG "two low fids - %d : 0x%x\n", j,
|
||||||
"0x%x\n", j, pst[j].fid);
|
pst[j].fid);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (pst[j].fid < lastfid)
|
if (pst[j].fid < lastfid)
|
||||||
lastfid = pst[j].fid;
|
lastfid = pst[j].fid;
|
||||||
}
|
}
|
||||||
if (lastfid & 1) {
|
if (lastfid & 1) {
|
||||||
printk(KERN_ERR FW_BUG PFX "lastfid invalid\n");
|
pr_err(FW_BUG "lastfid invalid\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (lastfid > LO_FID_TABLE_TOP)
|
if (lastfid > LO_FID_TABLE_TOP)
|
||||||
printk(KERN_INFO FW_BUG PFX
|
pr_info(FW_BUG "first fid not from lo freq table\n");
|
||||||
"first fid not from lo freq table\n");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -582,16 +558,14 @@ static void print_basics(struct powernow_k8_data *data)
|
||||||
for (j = 0; j < data->numps; j++) {
|
for (j = 0; j < data->numps; j++) {
|
||||||
if (data->powernow_table[j].frequency !=
|
if (data->powernow_table[j].frequency !=
|
||||||
CPUFREQ_ENTRY_INVALID) {
|
CPUFREQ_ENTRY_INVALID) {
|
||||||
printk(KERN_INFO PFX
|
pr_info("fid 0x%x (%d MHz), vid 0x%x\n",
|
||||||
"fid 0x%x (%d MHz), vid 0x%x\n",
|
data->powernow_table[j].driver_data & 0xff,
|
||||||
data->powernow_table[j].driver_data & 0xff,
|
data->powernow_table[j].frequency/1000,
|
||||||
data->powernow_table[j].frequency/1000,
|
data->powernow_table[j].driver_data >> 8);
|
||||||
data->powernow_table[j].driver_data >> 8);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data->batps)
|
if (data->batps)
|
||||||
printk(KERN_INFO PFX "Only %d pstates on battery\n",
|
pr_info("Only %d pstates on battery\n", data->batps);
|
||||||
data->batps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fill_powernow_table(struct powernow_k8_data *data,
|
static int fill_powernow_table(struct powernow_k8_data *data,
|
||||||
|
@ -602,21 +576,20 @@ static int fill_powernow_table(struct powernow_k8_data *data,
|
||||||
|
|
||||||
if (data->batps) {
|
if (data->batps) {
|
||||||
/* use ACPI support to get full speed on mains power */
|
/* use ACPI support to get full speed on mains power */
|
||||||
printk(KERN_WARNING PFX
|
pr_warn("Only %d pstates usable (use ACPI driver for full range\n",
|
||||||
"Only %d pstates usable (use ACPI driver for full "
|
data->batps);
|
||||||
"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");
|
pr_err("PST out of sequence\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->numps < 2) {
|
if (data->numps < 2) {
|
||||||
printk(KERN_ERR PFX "no p states to transition\n");
|
pr_err("no p states to transition\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,7 +599,7 @@ static int fill_powernow_table(struct powernow_k8_data *data,
|
||||||
powernow_table = kzalloc((sizeof(*powernow_table)
|
powernow_table = kzalloc((sizeof(*powernow_table)
|
||||||
* (data->numps + 1)), GFP_KERNEL);
|
* (data->numps + 1)), GFP_KERNEL);
|
||||||
if (!powernow_table) {
|
if (!powernow_table) {
|
||||||
printk(KERN_ERR PFX "powernow_table memory alloc failure\n");
|
pr_err("powernow_table memory alloc failure\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -681,13 +654,13 @@ static int find_psb_table(struct powernow_k8_data *data)
|
||||||
|
|
||||||
pr_debug("table vers: 0x%x\n", psb->tableversion);
|
pr_debug("table vers: 0x%x\n", psb->tableversion);
|
||||||
if (psb->tableversion != PSB_VERSION_1_4) {
|
if (psb->tableversion != PSB_VERSION_1_4) {
|
||||||
printk(KERN_ERR FW_BUG PFX "PSB table is not v1.4\n");
|
pr_err(FW_BUG "PSB table is not v1.4\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_debug("flags: 0x%x\n", psb->flags1);
|
pr_debug("flags: 0x%x\n", psb->flags1);
|
||||||
if (psb->flags1) {
|
if (psb->flags1) {
|
||||||
printk(KERN_ERR FW_BUG PFX "unknown flags\n");
|
pr_err(FW_BUG "unknown flags\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,7 +689,7 @@ static int find_psb_table(struct powernow_k8_data *data)
|
||||||
cpst = 1;
|
cpst = 1;
|
||||||
}
|
}
|
||||||
if (cpst != 1) {
|
if (cpst != 1) {
|
||||||
printk(KERN_ERR FW_BUG PFX "numpst must be 1\n");
|
pr_err(FW_BUG "numpst must be 1\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -742,9 +715,8 @@ static int find_psb_table(struct powernow_k8_data *data)
|
||||||
* BIOS and Kernel Developer's Guide, which is available on
|
* BIOS and Kernel Developer's Guide, which is available on
|
||||||
* www.amd.com
|
* www.amd.com
|
||||||
*/
|
*/
|
||||||
printk(KERN_ERR FW_BUG PFX "No PSB or ACPI _PSS objects\n");
|
pr_err(FW_BUG "No PSB or ACPI _PSS objects\n");
|
||||||
printk(KERN_ERR PFX "Make sure that your BIOS is up to date"
|
pr_err("Make sure that your BIOS is up to date and Cool'N'Quiet support is enabled in BIOS setup\n");
|
||||||
" and Cool'N'Quiet support is enabled in BIOS setup\n");
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,8 +791,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
|
||||||
acpi_processor_notify_smm(THIS_MODULE);
|
acpi_processor_notify_smm(THIS_MODULE);
|
||||||
|
|
||||||
if (!zalloc_cpumask_var(&data->acpi_data.shared_cpu_map, GFP_KERNEL)) {
|
if (!zalloc_cpumask_var(&data->acpi_data.shared_cpu_map, GFP_KERNEL)) {
|
||||||
printk(KERN_ERR PFX
|
pr_err("unable to alloc powernow_k8_data cpumask\n");
|
||||||
"unable to alloc powernow_k8_data cpumask\n");
|
|
||||||
ret_val = -ENOMEM;
|
ret_val = -ENOMEM;
|
||||||
goto err_out_mem;
|
goto err_out_mem;
|
||||||
}
|
}
|
||||||
|
@ -885,9 +856,8 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (freq != (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 "
|
pr_info("invalid freq entries %u kHz vs. %u kHz\n",
|
||||||
"%u kHz vs. %u kHz\n", freq,
|
freq, (unsigned int)
|
||||||
(unsigned int)
|
|
||||||
(data->acpi_data.states[i].core_frequency
|
(data->acpi_data.states[i].core_frequency
|
||||||
* 1000));
|
* 1000));
|
||||||
invalidate_entry(powernow_table, i);
|
invalidate_entry(powernow_table, i);
|
||||||
|
@ -916,7 +886,7 @@ static int get_transition_latency(struct powernow_k8_data *data)
|
||||||
max_latency = cur_latency;
|
max_latency = cur_latency;
|
||||||
}
|
}
|
||||||
if (max_latency == 0) {
|
if (max_latency == 0) {
|
||||||
pr_err(FW_WARN PFX "Invalid zero transition latency\n");
|
pr_err(FW_WARN "Invalid zero transition latency\n");
|
||||||
max_latency = 1;
|
max_latency = 1;
|
||||||
}
|
}
|
||||||
/* value in usecs, needs to be in nanoseconds */
|
/* value in usecs, needs to be in nanoseconds */
|
||||||
|
@ -991,7 +961,7 @@ static long powernowk8_target_fn(void *arg)
|
||||||
checkvid = data->currvid;
|
checkvid = data->currvid;
|
||||||
|
|
||||||
if (pending_bit_stuck()) {
|
if (pending_bit_stuck()) {
|
||||||
printk(KERN_ERR PFX "failing targ, change pending bit set\n");
|
pr_err("failing targ, change pending bit set\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1003,12 +973,11 @@ static long powernowk8_target_fn(void *arg)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
pr_debug("targ: curr fid 0x%x, vid 0x%x\n",
|
pr_debug("targ: curr fid 0x%x, vid 0x%x\n",
|
||||||
data->currfid, data->currvid);
|
data->currfid, data->currvid);
|
||||||
|
|
||||||
if ((checkvid != data->currvid) ||
|
if ((checkvid != data->currvid) ||
|
||||||
(checkfid != data->currfid)) {
|
(checkfid != data->currfid)) {
|
||||||
pr_info(PFX
|
pr_info("error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n",
|
||||||
"error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n",
|
|
||||||
checkfid, data->currfid,
|
checkfid, data->currfid,
|
||||||
checkvid, data->currvid);
|
checkvid, data->currvid);
|
||||||
}
|
}
|
||||||
|
@ -1020,7 +989,7 @@ static long powernowk8_target_fn(void *arg)
|
||||||
ret = transition_frequency_fidvid(data, newstate);
|
ret = transition_frequency_fidvid(data, newstate);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk(KERN_ERR PFX "transition frequency failed\n");
|
pr_err("transition frequency failed\n");
|
||||||
mutex_unlock(&fidvid_mutex);
|
mutex_unlock(&fidvid_mutex);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1049,7 +1018,7 @@ static void powernowk8_cpu_init_on_cpu(void *_init_on_cpu)
|
||||||
struct init_on_cpu *init_on_cpu = _init_on_cpu;
|
struct init_on_cpu *init_on_cpu = _init_on_cpu;
|
||||||
|
|
||||||
if (pending_bit_stuck()) {
|
if (pending_bit_stuck()) {
|
||||||
printk(KERN_ERR PFX "failing init, change pending bit set\n");
|
pr_err("failing init, change pending bit set\n");
|
||||||
init_on_cpu->rc = -ENODEV;
|
init_on_cpu->rc = -ENODEV;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1064,11 +1033,10 @@ static void powernowk8_cpu_init_on_cpu(void *_init_on_cpu)
|
||||||
init_on_cpu->rc = 0;
|
init_on_cpu->rc = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char missing_pss_msg[] =
|
#define MISSING_PSS_MSG \
|
||||||
KERN_ERR
|
FW_BUG "No compatible ACPI _PSS objects found.\n" \
|
||||||
FW_BUG PFX "No compatible ACPI _PSS objects found.\n"
|
FW_BUG "First, make sure Cool'N'Quiet is enabled in the BIOS.\n" \
|
||||||
FW_BUG PFX "First, make sure Cool'N'Quiet is enabled in the BIOS.\n"
|
FW_BUG "If that doesn't help, try upgrading your BIOS.\n"
|
||||||
FW_BUG PFX "If that doesn't help, try upgrading your BIOS.\n";
|
|
||||||
|
|
||||||
/* per CPU init entry point to the driver */
|
/* per CPU init entry point to the driver */
|
||||||
static int powernowk8_cpu_init(struct cpufreq_policy *pol)
|
static int powernowk8_cpu_init(struct cpufreq_policy *pol)
|
||||||
|
@ -1083,7 +1051,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
|
||||||
|
|
||||||
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
printk(KERN_ERR PFX "unable to alloc powernow_k8_data");
|
pr_err("unable to alloc powernow_k8_data");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1095,13 +1063,11 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
|
||||||
* an UP version, and is deprecated by AMD.
|
* an UP version, and is deprecated by AMD.
|
||||||
*/
|
*/
|
||||||
if (num_online_cpus() != 1) {
|
if (num_online_cpus() != 1) {
|
||||||
printk_once(missing_pss_msg);
|
pr_err_once(MISSING_PSS_MSG);
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
if (pol->cpu != 0) {
|
if (pol->cpu != 0) {
|
||||||
printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
|
pr_err(FW_BUG "No ACPI _PSS objects for CPU other than CPU0. Complain to your BIOS vendor.\n");
|
||||||
"CPU other than CPU0. Complain to your BIOS "
|
|
||||||
"vendor.\n");
|
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
rc = find_psb_table(data);
|
rc = find_psb_table(data);
|
||||||
|
@ -1129,7 +1095,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
|
||||||
|
|
||||||
/* min/max the cpu is capable of */
|
/* min/max the cpu is capable of */
|
||||||
if (cpufreq_table_validate_and_show(pol, data->powernow_table)) {
|
if (cpufreq_table_validate_and_show(pol, data->powernow_table)) {
|
||||||
printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n");
|
pr_err(FW_BUG "invalid powernow_table\n");
|
||||||
powernow_k8_cpu_exit_acpi(data);
|
powernow_k8_cpu_exit_acpi(data);
|
||||||
kfree(data->powernow_table);
|
kfree(data->powernow_table);
|
||||||
kfree(data);
|
kfree(data);
|
||||||
|
@ -1137,7 +1103,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol)
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n",
|
pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n",
|
||||||
data->currfid, data->currvid);
|
data->currfid, data->currvid);
|
||||||
|
|
||||||
/* Point all the CPUs in this policy to the same data */
|
/* Point all the CPUs in this policy to the same data */
|
||||||
for_each_cpu(cpu, pol->cpus)
|
for_each_cpu(cpu, pol->cpus)
|
||||||
|
@ -1220,12 +1186,12 @@ static void __request_acpi_cpufreq(void)
|
||||||
goto request;
|
goto request;
|
||||||
|
|
||||||
if (strncmp(cur_drv, drv, min_t(size_t, strlen(cur_drv), strlen(drv))))
|
if (strncmp(cur_drv, drv, min_t(size_t, strlen(cur_drv), strlen(drv))))
|
||||||
pr_warn(PFX "WTF driver: %s\n", cur_drv);
|
pr_warn("WTF driver: %s\n", cur_drv);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
request:
|
request:
|
||||||
pr_warn(PFX "This CPU is not supported anymore, using acpi-cpufreq instead.\n");
|
pr_warn("This CPU is not supported anymore, using acpi-cpufreq instead.\n");
|
||||||
request_module(drv);
|
request_module(drv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1260,7 +1226,7 @@ static int powernowk8_init(void)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
pr_info(PFX "Found %d %s (%d cpu cores) (" VERSION ")\n",
|
pr_info("Found %d %s (%d cpu cores) (" VERSION ")\n",
|
||||||
num_online_nodes(), boot_cpu_data.x86_model_id, supported_cpus);
|
num_online_nodes(), boot_cpu_data.x86_model_id, supported_cpus);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1274,8 +1240,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 "
|
MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com>");
|
||||||
"Mark Langsdorf <mark.langsdorf@amd.com>");
|
MODULE_AUTHOR("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");
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ struct powernow_k8_data {
|
||||||
u32 vidmvs; /* usable value calculated from mvs */
|
u32 vidmvs; /* usable value calculated from mvs */
|
||||||
u32 vstable; /* voltage stabilization time, units 20 us */
|
u32 vstable; /* voltage stabilization time, units 20 us */
|
||||||
u32 plllock; /* pll lock time, units 1 us */
|
u32 plllock; /* pll lock time, units 1 us */
|
||||||
u32 exttype; /* extended interface = 1 */
|
u32 exttype; /* extended interface = 1 */
|
||||||
|
|
||||||
/* keep track of the current fid / vid or pstate */
|
/* keep track of the current fid / vid or pstate */
|
||||||
u32 currvid;
|
u32 currvid;
|
||||||
|
|
Loading…
Reference in New Issue