Commit 2d06d8c4 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Dave Jones

[CPUFREQ] use dynamic debug instead of custom infrastructure

With dynamic debug having gained the capability to report debug messages
also during the boot process, it offers a far superior interface for
debug messages than the custom cpufreq infrastructure. As a first step,
remove the old cpufreq_debug_printk() function and replace it with a call
to the generic pr_debug() function.

How can dynamic debug be used on cpufreq? You need a kernel which has
CONFIG_DYNAMIC_DEBUG enabled.

To enabled debugging during runtime, mount debugfs and

$ echo -n 'module cpufreq +p' > /sys/kernel/debug/dynamic_debug/control

for debugging the complete "cpufreq" module. To achieve the same goal during
boot, append

	ddebug_query="module cpufreq +p"

as a boot parameter to the kernel of your choice.

For more detailled instructions, please see
Documentation/dynamic-debug-howto.txt
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 27ecddc2
...@@ -94,9 +94,7 @@ static int davinci_target(struct cpufreq_policy *policy, ...@@ -94,9 +94,7 @@ static int davinci_target(struct cpufreq_policy *policy,
if (freqs.old == freqs.new) if (freqs.old == freqs.new)
return ret; return ret;
cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, dev_dbg(&cpufreq.dev, "transition: %u --> %u\n", freqs.old, freqs.new);
dev_driver_string(cpufreq.dev),
"transition: %u --> %u\n", freqs.old, freqs.new);
ret = cpufreq_frequency_table_target(policy, pdata->freq_table, ret = cpufreq_frequency_table_target(policy, pdata->freq_table,
freqs.new, relation, &idx); freqs.new, relation, &idx);
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
#define DRIVER_NAME "bfin dpmc" #define DRIVER_NAME "bfin dpmc"
#define dprintk(msg...) \
cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, DRIVER_NAME, msg)
struct bfin_dpmc_platform_data *pdata; struct bfin_dpmc_platform_data *pdata;
/** /**
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <acpi/processor.h> #include <acpi/processor.h>
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg)
MODULE_AUTHOR("Venkatesh Pallipadi"); MODULE_AUTHOR("Venkatesh Pallipadi");
MODULE_DESCRIPTION("ACPI Processor P-States Driver"); MODULE_DESCRIPTION("ACPI Processor P-States Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -47,12 +45,12 @@ processor_set_pstate ( ...@@ -47,12 +45,12 @@ processor_set_pstate (
{ {
s64 retval; s64 retval;
dprintk("processor_set_pstate\n"); pr_debug("processor_set_pstate\n");
retval = ia64_pal_set_pstate((u64)value); retval = ia64_pal_set_pstate((u64)value);
if (retval) { if (retval) {
dprintk("Failed to set freq to 0x%x, with error 0x%lx\n", pr_debug("Failed to set freq to 0x%x, with error 0x%lx\n",
value, retval); value, retval);
return -ENODEV; return -ENODEV;
} }
...@@ -67,14 +65,14 @@ processor_get_pstate ( ...@@ -67,14 +65,14 @@ processor_get_pstate (
u64 pstate_index = 0; u64 pstate_index = 0;
s64 retval; s64 retval;
dprintk("processor_get_pstate\n"); pr_debug("processor_get_pstate\n");
retval = ia64_pal_get_pstate(&pstate_index, retval = ia64_pal_get_pstate(&pstate_index,
PAL_GET_PSTATE_TYPE_INSTANT); PAL_GET_PSTATE_TYPE_INSTANT);
*value = (u32) pstate_index; *value = (u32) pstate_index;
if (retval) if (retval)
dprintk("Failed to get current freq with " pr_debug("Failed to get current freq with "
"error 0x%lx, idx 0x%x\n", retval, *value); "error 0x%lx, idx 0x%x\n", retval, *value);
return (int)retval; return (int)retval;
...@@ -90,7 +88,7 @@ extract_clock ( ...@@ -90,7 +88,7 @@ extract_clock (
{ {
unsigned long i; unsigned long i;
dprintk("extract_clock\n"); pr_debug("extract_clock\n");
for (i = 0; i < data->acpi_data.state_count; i++) { for (i = 0; i < data->acpi_data.state_count; i++) {
if (value == data->acpi_data.states[i].status) if (value == data->acpi_data.states[i].status)
...@@ -110,7 +108,7 @@ processor_get_freq ( ...@@ -110,7 +108,7 @@ processor_get_freq (
cpumask_t saved_mask; cpumask_t saved_mask;
unsigned long clock_freq; unsigned long clock_freq;
dprintk("processor_get_freq\n"); pr_debug("processor_get_freq\n");
saved_mask = current->cpus_allowed; saved_mask = current->cpus_allowed;
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
...@@ -148,7 +146,7 @@ processor_set_freq ( ...@@ -148,7 +146,7 @@ processor_set_freq (
cpumask_t saved_mask; cpumask_t saved_mask;
int retval; int retval;
dprintk("processor_set_freq\n"); pr_debug("processor_set_freq\n");
saved_mask = current->cpus_allowed; saved_mask = current->cpus_allowed;
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
...@@ -159,16 +157,16 @@ processor_set_freq ( ...@@ -159,16 +157,16 @@ processor_set_freq (
if (state == data->acpi_data.state) { if (state == data->acpi_data.state) {
if (unlikely(data->resume)) { if (unlikely(data->resume)) {
dprintk("Called after resume, resetting to P%d\n", state); pr_debug("Called after resume, resetting to P%d\n", state);
data->resume = 0; data->resume = 0;
} else { } else {
dprintk("Already at target state (P%d)\n", state); pr_debug("Already at target state (P%d)\n", state);
retval = 0; retval = 0;
goto migrate_end; goto migrate_end;
} }
} }
dprintk("Transitioning from P%d to P%d\n", pr_debug("Transitioning from P%d to P%d\n",
data->acpi_data.state, state); data->acpi_data.state, state);
/* cpufreq frequency struct */ /* cpufreq frequency struct */
...@@ -186,7 +184,7 @@ processor_set_freq ( ...@@ -186,7 +184,7 @@ processor_set_freq (
value = (u32) data->acpi_data.states[state].control; value = (u32) data->acpi_data.states[state].control;
dprintk("Transitioning to state: 0x%08x\n", value); pr_debug("Transitioning to state: 0x%08x\n", value);
ret = processor_set_pstate(value); ret = processor_set_pstate(value);
if (ret) { if (ret) {
...@@ -219,7 +217,7 @@ acpi_cpufreq_get ( ...@@ -219,7 +217,7 @@ acpi_cpufreq_get (
{ {
struct cpufreq_acpi_io *data = acpi_io_data[cpu]; struct cpufreq_acpi_io *data = acpi_io_data[cpu];
dprintk("acpi_cpufreq_get\n"); pr_debug("acpi_cpufreq_get\n");
return processor_get_freq(data, cpu); return processor_get_freq(data, cpu);
} }
...@@ -235,7 +233,7 @@ acpi_cpufreq_target ( ...@@ -235,7 +233,7 @@ acpi_cpufreq_target (
unsigned int next_state = 0; unsigned int next_state = 0;
unsigned int result = 0; unsigned int result = 0;
dprintk("acpi_cpufreq_setpolicy\n"); pr_debug("acpi_cpufreq_setpolicy\n");
result = cpufreq_frequency_table_target(policy, result = cpufreq_frequency_table_target(policy,
data->freq_table, target_freq, relation, &next_state); data->freq_table, target_freq, relation, &next_state);
...@@ -255,7 +253,7 @@ acpi_cpufreq_verify ( ...@@ -255,7 +253,7 @@ acpi_cpufreq_verify (
unsigned int result = 0; unsigned int result = 0;
struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
dprintk("acpi_cpufreq_verify\n"); pr_debug("acpi_cpufreq_verify\n");
result = cpufreq_frequency_table_verify(policy, result = cpufreq_frequency_table_verify(policy,
data->freq_table); data->freq_table);
...@@ -273,7 +271,7 @@ acpi_cpufreq_cpu_init ( ...@@ -273,7 +271,7 @@ acpi_cpufreq_cpu_init (
struct cpufreq_acpi_io *data; struct cpufreq_acpi_io *data;
unsigned int result = 0; unsigned int result = 0;
dprintk("acpi_cpufreq_cpu_init\n"); pr_debug("acpi_cpufreq_cpu_init\n");
data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
if (!data) if (!data)
...@@ -288,7 +286,7 @@ acpi_cpufreq_cpu_init ( ...@@ -288,7 +286,7 @@ acpi_cpufreq_cpu_init (
/* capability check */ /* capability check */
if (data->acpi_data.state_count <= 1) { if (data->acpi_data.state_count <= 1) {
dprintk("No P-States\n"); pr_debug("No P-States\n");
result = -ENODEV; result = -ENODEV;
goto err_unreg; goto err_unreg;
} }
...@@ -297,7 +295,7 @@ acpi_cpufreq_cpu_init ( ...@@ -297,7 +295,7 @@ acpi_cpufreq_cpu_init (
ACPI_ADR_SPACE_FIXED_HARDWARE) || ACPI_ADR_SPACE_FIXED_HARDWARE) ||
(data->acpi_data.status_register.space_id != (data->acpi_data.status_register.space_id !=
ACPI_ADR_SPACE_FIXED_HARDWARE)) { ACPI_ADR_SPACE_FIXED_HARDWARE)) {
dprintk("Unsupported address space [%d, %d]\n", pr_debug("Unsupported address space [%d, %d]\n",
(u32) (data->acpi_data.control_register.space_id), (u32) (data->acpi_data.control_register.space_id),
(u32) (data->acpi_data.status_register.space_id)); (u32) (data->acpi_data.status_register.space_id));
result = -ENODEV; result = -ENODEV;
...@@ -348,7 +346,7 @@ acpi_cpufreq_cpu_init ( ...@@ -348,7 +346,7 @@ acpi_cpufreq_cpu_init (
"activated.\n", cpu); "activated.\n", cpu);
for (i = 0; i < data->acpi_data.state_count; i++) for (i = 0; i < data->acpi_data.state_count; i++)
dprintk(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n", pr_debug(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n",
(i == data->acpi_data.state?'*':' '), i, (i == data->acpi_data.state?'*':' '), i,
(u32) data->acpi_data.states[i].core_frequency, (u32) data->acpi_data.states[i].core_frequency,
(u32) data->acpi_data.states[i].power, (u32) data->acpi_data.states[i].power,
...@@ -383,7 +381,7 @@ acpi_cpufreq_cpu_exit ( ...@@ -383,7 +381,7 @@ acpi_cpufreq_cpu_exit (
{ {
struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
dprintk("acpi_cpufreq_cpu_exit\n"); pr_debug("acpi_cpufreq_cpu_exit\n");
if (data) { if (data) {
cpufreq_frequency_table_put_attr(policy->cpu); cpufreq_frequency_table_put_attr(policy->cpu);
...@@ -418,7 +416,7 @@ static struct cpufreq_driver acpi_cpufreq_driver = { ...@@ -418,7 +416,7 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
static int __init static int __init
acpi_cpufreq_init (void) acpi_cpufreq_init (void)
{ {
dprintk("acpi_cpufreq_init\n"); pr_debug("acpi_cpufreq_init\n");
return cpufreq_register_driver(&acpi_cpufreq_driver); return cpufreq_register_driver(&acpi_cpufreq_driver);
} }
...@@ -427,7 +425,7 @@ acpi_cpufreq_init (void) ...@@ -427,7 +425,7 @@ acpi_cpufreq_init (void)
static void __exit static void __exit
acpi_cpufreq_exit (void) acpi_cpufreq_exit (void)
{ {
dprintk("acpi_cpufreq_exit\n"); pr_debug("acpi_cpufreq_exit\n");
cpufreq_unregister_driver(&acpi_cpufreq_driver); cpufreq_unregister_driver(&acpi_cpufreq_driver);
return; return;
......
...@@ -47,9 +47,6 @@ ...@@ -47,9 +47,6 @@
#include <asm/cpufeature.h> #include <asm/cpufeature.h>
#include "mperf.h" #include "mperf.h"
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"acpi-cpufreq", msg)
MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski"); MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
MODULE_DESCRIPTION("ACPI Processor P-States Driver"); MODULE_DESCRIPTION("ACPI Processor P-States Driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -233,7 +230,7 @@ static u32 get_cur_val(const struct cpumask *mask) ...@@ -233,7 +230,7 @@ static u32 get_cur_val(const struct cpumask *mask)
cmd.mask = mask; cmd.mask = mask;
drv_read(&cmd); drv_read(&cmd);
dprintk("get_cur_val = %u\n", cmd.val); pr_debug("get_cur_val = %u\n", cmd.val);
return cmd.val; return cmd.val;
} }
...@@ -244,7 +241,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) ...@@ -244,7 +241,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
unsigned int freq; unsigned int freq;
unsigned int cached_freq; unsigned int cached_freq;
dprintk("get_cur_freq_on_cpu (%d)\n", cpu); pr_debug("get_cur_freq_on_cpu (%d)\n", cpu);
if (unlikely(data == NULL || if (unlikely(data == NULL ||
data->acpi_data == NULL || data->freq_table == NULL)) { data->acpi_data == NULL || data->freq_table == NULL)) {
...@@ -261,7 +258,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) ...@@ -261,7 +258,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
data->resume = 1; data->resume = 1;
} }
dprintk("cur freq = %u\n", freq); pr_debug("cur freq = %u\n", freq);
return freq; return freq;
} }
...@@ -293,7 +290,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, ...@@ -293,7 +290,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
unsigned int i; unsigned int i;
int result = 0; int result = 0;
dprintk("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu); pr_debug("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu);
if (unlikely(data == NULL || if (unlikely(data == NULL ||
data->acpi_data == NULL || data->freq_table == NULL)) { data->acpi_data == NULL || data->freq_table == NULL)) {
...@@ -313,11 +310,11 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, ...@@ -313,11 +310,11 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
next_perf_state = data->freq_table[next_state].index; next_perf_state = data->freq_table[next_state].index;
if (perf->state == next_perf_state) { if (perf->state == next_perf_state) {
if (unlikely(data->resume)) { if (unlikely(data->resume)) {
dprintk("Called after resume, resetting to P%d\n", pr_debug("Called after resume, resetting to P%d\n",
next_perf_state); next_perf_state);
data->resume = 0; data->resume = 0;
} else { } else {
dprintk("Already at target state (P%d)\n", pr_debug("Already at target state (P%d)\n",
next_perf_state); next_perf_state);
goto out; goto out;
} }
...@@ -357,7 +354,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy, ...@@ -357,7 +354,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
if (acpi_pstate_strict) { if (acpi_pstate_strict) {
if (!check_freqs(cmd.mask, freqs.new, data)) { if (!check_freqs(cmd.mask, freqs.new, data)) {
dprintk("acpi_cpufreq_target failed (%d)\n", pr_debug("acpi_cpufreq_target failed (%d)\n",
policy->cpu); policy->cpu);
result = -EAGAIN; result = -EAGAIN;
goto out; goto out;
...@@ -378,7 +375,7 @@ static int acpi_cpufreq_verify(struct cpufreq_policy *policy) ...@@ -378,7 +375,7 @@ static int acpi_cpufreq_verify(struct cpufreq_policy *policy)
{ {
struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu); struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
dprintk("acpi_cpufreq_verify\n"); pr_debug("acpi_cpufreq_verify\n");
return cpufreq_frequency_table_verify(policy, data->freq_table); return cpufreq_frequency_table_verify(policy, data->freq_table);
} }
...@@ -433,11 +430,11 @@ static void free_acpi_perf_data(void) ...@@ -433,11 +430,11 @@ static void free_acpi_perf_data(void)
static int __init acpi_cpufreq_early_init(void) static int __init acpi_cpufreq_early_init(void)
{ {
unsigned int i; unsigned int i;
dprintk("acpi_cpufreq_early_init\n"); pr_debug("acpi_cpufreq_early_init\n");
acpi_perf_data = alloc_percpu(struct acpi_processor_performance); acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
if (!acpi_perf_data) { if (!acpi_perf_data) {
dprintk("Memory allocation error for acpi_perf_data.\n"); pr_debug("Memory allocation error for acpi_perf_data.\n");
return -ENOMEM; return -ENOMEM;
} }
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
...@@ -519,7 +516,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -519,7 +516,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
static int blacklisted; static int blacklisted;
#endif #endif
dprintk("acpi_cpufreq_cpu_init\n"); pr_debug("acpi_cpufreq_cpu_init\n");
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
if (blacklisted) if (blacklisted)
...@@ -566,7 +563,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -566,7 +563,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
/* capability check */ /* capability check */
if (perf->state_count <= 1) { if (perf->state_count <= 1) {
dprintk("No P-States\n"); pr_debug("No P-States\n");
result = -ENODEV; result = -ENODEV;
goto err_unreg; goto err_unreg;
} }
...@@ -578,11 +575,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -578,11 +575,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
switch (perf->control_register.space_id) { switch (perf->control_register.space_id) {
case ACPI_ADR_SPACE_SYSTEM_IO: case ACPI_ADR_SPACE_SYSTEM_IO:
dprintk("SYSTEM IO addr space\n"); pr_debug("SYSTEM IO addr space\n");
data->cpu_feature = SYSTEM_IO_CAPABLE; data->cpu_feature = SYSTEM_IO_CAPABLE;
break; break;
case ACPI_ADR_SPACE_FIXED_HARDWARE: case ACPI_ADR_SPACE_FIXED_HARDWARE:
dprintk("HARDWARE addr space\n"); pr_debug("HARDWARE addr space\n");
if (!check_est_cpu(cpu)) { if (!check_est_cpu(cpu)) {
result = -ENODEV; result = -ENODEV;
goto err_unreg; goto err_unreg;
...@@ -590,7 +587,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -590,7 +587,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
data->cpu_feature = SYSTEM_INTEL_MSR_CAPABLE; data->cpu_feature = SYSTEM_INTEL_MSR_CAPABLE;
break; break;
default: default:
dprintk("Unknown addr space %d\n", pr_debug("Unknown addr space %d\n",
(u32) (perf->control_register.space_id)); (u32) (perf->control_register.space_id));
result = -ENODEV; result = -ENODEV;
goto err_unreg; goto err_unreg;
...@@ -661,9 +658,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -661,9 +658,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
if (cpu_has(c, X86_FEATURE_APERFMPERF)) if (cpu_has(c, X86_FEATURE_APERFMPERF))
acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf; acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf;
dprintk("CPU%u - ACPI performance management activated.\n", cpu); pr_debug("CPU%u - ACPI performance management activated.\n", cpu);
for (i = 0; i < perf->state_count; i++) for (i = 0; i < perf->state_count; i++)
dprintk(" %cP%d: %d MHz, %d mW, %d uS\n", pr_debug(" %cP%d: %d MHz, %d mW, %d uS\n",
(i == perf->state ? '*' : ' '), i, (i == perf->state ? '*' : ' '), i,
(u32) perf->states[i].core_frequency, (u32) perf->states[i].core_frequency,
(u32) perf->states[i].power, (u32) perf->states[i].power,
...@@ -694,7 +691,7 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy) ...@@ -694,7 +691,7 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
{ {
struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu); struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
dprintk("acpi_cpufreq_cpu_exit\n"); pr_debug("acpi_cpufreq_cpu_exit\n");
if (data) { if (data) {
cpufreq_frequency_table_put_attr(policy->cpu); cpufreq_frequency_table_put_attr(policy->cpu);
...@@ -712,7 +709,7 @@ static int acpi_cpufreq_resume(struct cpufreq_policy *policy) ...@@ -712,7 +709,7 @@ static int acpi_cpufreq_resume(struct cpufreq_policy *policy)
{ {
struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu); struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
dprintk("acpi_cpufreq_resume\n"); pr_debug("acpi_cpufreq_resume\n");
data->resume = 1; data->resume = 1;
...@@ -743,7 +740,7 @@ static int __init acpi_cpufreq_init(void) ...@@ -743,7 +740,7 @@ static int __init acpi_cpufreq_init(void)
if (acpi_disabled) if (acpi_disabled)
return 0; return 0;
dprintk("acpi_cpufreq_init\n"); pr_debug("acpi_cpufreq_init\n");
ret = acpi_cpufreq_early_init(); ret = acpi_cpufreq_early_init();
if (ret) if (ret)
...@@ -758,7 +755,7 @@ static int __init acpi_cpufreq_init(void) ...@@ -758,7 +755,7 @@ static int __init acpi_cpufreq_init(void)
static void __exit acpi_cpufreq_exit(void) static void __exit acpi_cpufreq_exit(void)
{ {
dprintk("acpi_cpufreq_exit\n"); pr_debug("acpi_cpufreq_exit\n");
cpufreq_unregister_driver(&acpi_cpufreq_driver); cpufreq_unregister_driver(&acpi_cpufreq_driver);
......
...@@ -57,8 +57,6 @@ MODULE_PARM_DESC(min_fsb, ...@@ -57,8 +57,6 @@ MODULE_PARM_DESC(min_fsb,
"Minimum FSB to use, if not defined: current FSB - 50"); "Minimum FSB to use, if not defined: current FSB - 50");
#define PFX "cpufreq-nforce2: " #define PFX "cpufreq-nforce2: "
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"cpufreq-nforce2", msg)
/** /**
* nforce2_calc_fsb - calculate FSB * nforce2_calc_fsb - calculate FSB
...@@ -270,7 +268,7 @@ static int nforce2_target(struct cpufreq_policy *policy, ...@@ -270,7 +268,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
if (freqs.old == freqs.new) if (freqs.old == freqs.new)
return 0; return 0;
dprintk("Old CPU frequency %d kHz, new %d kHz\n", pr_debug("Old CPU frequency %d kHz, new %d kHz\n",
freqs.old, freqs.new); freqs.old, freqs.new);
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
...@@ -282,7 +280,7 @@ static int nforce2_target(struct cpufreq_policy *policy, ...@@ -282,7 +280,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
printk(KERN_ERR PFX "Changing FSB to %d failed\n", printk(KERN_ERR PFX "Changing FSB to %d failed\n",
target_fsb); target_fsb);
else else
dprintk("Changed FSB successfully to %d\n", pr_debug("Changed FSB successfully to %d\n",
target_fsb); target_fsb);
/* Enable IRQs */ /* Enable IRQs */
......
...@@ -142,9 +142,6 @@ module_param(max_duration, int, 0444); ...@@ -142,9 +142,6 @@ module_param(max_duration, int, 0444);
#define POLICY_MIN_DIV 20 #define POLICY_MIN_DIV 20
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"gx-suspmod", msg)
/** /**
* we can detect a core multipiler from dir0_lsb * we can detect a core multipiler from dir0_lsb
* from GX1 datasheet p.56, * from GX1 datasheet p.56,
...@@ -191,7 +188,7 @@ static __init struct pci_dev *gx_detect_chipset(void) ...@@ -191,7 +188,7 @@ static __init struct pci_dev *gx_detect_chipset(void)
/* check if CPU is a MediaGX or a Geode. */ /* check if CPU is a MediaGX or a Geode. */
if ((boot_cpu_data.x86_vendor != X86_VENDOR_NSC) && if ((boot_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
(boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) { (boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
dprintk("error: no MediaGX/Geode processor found!\n"); pr_debug("error: no MediaGX/Geode processor found!\n");
return NULL; return NULL;
} }
...@@ -201,7 +198,7 @@ static __init struct pci_dev *gx_detect_chipset(void) ...@@ -201,7 +198,7 @@ static __init struct pci_dev *gx_detect_chipset(void)
return gx_pci; return gx_pci;
} }
dprintk("error: no supported chipset found!\n"); pr_debug("error: no supported chipset found!\n");
return NULL; return NULL;
} }
...@@ -305,14 +302,14 @@ static void gx_set_cpuspeed(unsigned int khz) ...@@ -305,14 +302,14 @@ static void gx_set_cpuspeed(unsigned int khz)
break; break;
default: default:
local_irq_restore(flags); local_irq_restore(flags);
dprintk("fatal: try to set unknown chipset.\n"); pr_debug("fatal: try to set unknown chipset.\n");
return; return;
} }
} else { } else {
suscfg = gx_params->pci_suscfg & ~(SUSMOD); suscfg = gx_params->pci_suscfg & ~(SUSMOD);
gx_params->off_duration = 0; gx_params->off_duration = 0;
gx_params->on_duration = 0; gx_params->on_duration = 0;
dprintk("suspend modulation disabled: cpu runs 100%% speed.\n"); pr_debug("suspend modulation disabled: cpu runs 100%% speed.\n");
} }
gx_write_byte(PCI_MODOFF, gx_params->off_duration); gx_write_byte(PCI_MODOFF, gx_params->off_duration);
...@@ -327,9 +324,9 @@ static void gx_set_cpuspeed(unsigned int khz) ...@@ -327,9 +324,9 @@ static void gx_set_cpuspeed(unsigned int khz)
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
dprintk("suspend modulation w/ duration of ON:%d us, OFF:%d us\n", pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n",
gx_params->on_duration * 32, gx_params->off_duration * 32); gx_params->on_duration * 32, gx_params->off_duration * 32);
dprintk("suspend modulation w/ clock speed: %d kHz.\n", freqs.new); pr_debug("suspend modulation w/ clock speed: %d kHz.\n", freqs.new);
} }
/**************************************************************** /****************************************************************
...@@ -428,8 +425,8 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy) ...@@ -428,8 +425,8 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
stock_freq = maxfreq; stock_freq = maxfreq;
curfreq = gx_get_cpuspeed(0); curfreq = gx_get_cpuspeed(0);
dprintk("cpu max frequency is %d.\n", maxfreq); pr_debug("cpu max frequency is %d.\n", maxfreq);
dprintk("cpu current frequency is %dkHz.\n", curfreq); pr_debug("cpu current frequency is %dkHz.\n", curfreq);
/* setup basic struct for cpufreq API */ /* setup basic struct for cpufreq API */
policy->cpu = 0; policy->cpu = 0;
...@@ -475,7 +472,7 @@ static int __init cpufreq_gx_init(void) ...@@ -475,7 +472,7 @@ static int __init cpufreq_gx_init(void)
if (max_duration > 0xff) if (max_duration > 0xff)
max_duration = 0xff; max_duration = 0xff;
dprintk("geode suspend modulation available.\n"); pr_debug("geode suspend modulation available.\n");
params = kzalloc(sizeof(struct gxfreq_params), GFP_KERNEL); params = kzalloc(sizeof(struct gxfreq_params), GFP_KERNEL);
if (params == NULL) if (params == NULL)
......
...@@ -77,9 +77,6 @@ static int scale_voltage; ...@@ -77,9 +77,6 @@ static int scale_voltage;
static int disable_acpi_c3; static int disable_acpi_c3;
static int revid_errata; static int revid_errata;
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"longhaul", msg)
/* Clock ratios multiplied by 10 */ /* Clock ratios multiplied by 10 */
static int mults[32]; static int mults[32];
...@@ -87,7 +84,6 @@ static int eblcr[32]; ...@@ -87,7 +84,6 @@ static int eblcr[32];
static int longhaul_version; static int longhaul_version;
static struct cpufreq_frequency_table *longhaul_table; static struct cpufreq_frequency_table *longhaul_table;
#ifdef CONFIG_CPU_FREQ_DEBUG
static char speedbuffer[8]; static char speedbuffer[8];
static char *print_speed(int speed) static char *print_speed(int speed)
...@@ -106,7 +102,6 @@ static char *print_speed(int speed) ...@@ -106,7 +102,6 @@ static char *print_speed(int speed)
return speedbuffer; return speedbuffer;
} }
#endif
static unsigned int calc_speed(int mult) static unsigned int calc_speed(int mult)
...@@ -275,7 +270,7 @@ static void longhaul_setstate(unsigned int table_index) ...@@ -275,7 +270,7 @@ static void longhaul_setstate(unsigned int table_index)
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
dprintk("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
fsb, mult/10, mult%10, print_speed(speed/1000)); fsb, mult/10, mult%10, print_speed(speed/1000));
retry_loop: retry_loop:
preempt_disable(); preempt_disable();
...@@ -460,12 +455,12 @@ static int __cpuinit longhaul_get_ranges(void) ...@@ -460,12 +455,12 @@ static int __cpuinit longhaul_get_ranges(void)
break; break;
} }
dprintk("MinMult:%d.%dx MaxMult:%d.%dx\n", pr_debug("MinMult:%d.%dx MaxMult:%d.%dx\n",
minmult/10, minmult%10, maxmult/10, maxmult%10); minmult/10, minmult%10, maxmult/10, maxmult%10);
highest_speed = calc_speed(maxmult); highest_speed = calc_speed(maxmult);
lowest_speed = calc_speed(minmult); lowest_speed = calc_speed(minmult);
dprintk("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, pr_debug("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb,
print_speed(lowest_speed/1000), print_speed(lowest_speed/1000),
print_speed(highest_speed/1000)); print_speed(highest_speed/1000));
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
#include <asm/msr.h> #include <asm/msr.h>
#include <asm/processor.h> #include <asm/processor.h>
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"longrun", msg)
static struct cpufreq_driver longrun_driver; static struct cpufreq_driver longrun_driver;
/** /**
...@@ -40,14 +37,14 @@ static void __cpuinit longrun_get_policy(struct cpufreq_policy *policy) ...@@ -40,14 +37,14 @@ static void __cpuinit longrun_get_policy(struct cpufreq_policy *policy)
u32 msr_lo, msr_hi; u32 msr_lo, msr_hi;
rdmsr(MSR_TMTA_LONGRUN_FLAGS, msr_lo, msr_hi); rdmsr(MSR_TMTA_LONGRUN_FLAGS, msr_lo, msr_hi);
dprintk("longrun flags are %x - %x\n", msr_lo, msr_hi); pr_debug("longrun flags are %x - %x\n", msr_lo, msr_hi);
if (msr_lo & 0x01) if (msr_lo & 0x01)
policy->policy = CPUFREQ_POLICY_PERFORMANCE; policy->policy = CPUFREQ_POLICY_PERFORMANCE;
else else
policy->policy = CPUFREQ_POLICY_POWERSAVE; policy->policy = CPUFREQ_POLICY_POWERSAVE;
rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi);
dprintk("longrun ctrl is %x - %x\n", msr_lo, msr_hi); pr_debug("longrun ctrl is %x - %x\n", msr_lo, msr_hi);
msr_lo &= 0x0000007F; msr_lo &= 0x0000007F;
msr_hi &= 0x0000007F; msr_hi &= 0x0000007F;
...@@ -150,7 +147,7 @@ static unsigned int longrun_get(unsigned int cpu) ...@@ -150,7 +147,7 @@ static unsigned int longrun_get(unsigned int cpu)
return 0; return 0;
cpuid(0x80860007, &eax, &ebx, &ecx, &edx); cpuid(0x80860007, &eax, &ebx, &ecx, &edx);
dprintk("cpuid eax is %u\n", eax); pr_debug("cpuid eax is %u\n", eax);
return eax * 1000; return eax * 1000;
} }
...@@ -196,7 +193,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq, ...@@ -196,7 +193,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi); rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi);
*high_freq = msr_lo * 1000; /* to kHz */ *high_freq = msr_lo * 1000; /* to kHz */
dprintk("longrun table interface told %u - %u kHz\n", pr_debug("longrun table interface told %u - %u kHz\n",
*low_freq, *high_freq); *low_freq, *high_freq);
if (*low_freq > *high_freq) if (*low_freq > *high_freq)
...@@ -207,7 +204,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq, ...@@ -207,7 +204,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
/* set the upper border to the value determined during TSC init */ /* set the upper border to the value determined during TSC init */
*high_freq = (cpu_khz / 1000); *high_freq = (cpu_khz / 1000);
*high_freq = *high_freq * 1000; *high_freq = *high_freq * 1000;
dprintk("high frequency is %u kHz\n", *high_freq); pr_debug("high frequency is %u kHz\n", *high_freq);
/* get current borders */ /* get current borders */
rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi);
...@@ -233,7 +230,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq, ...@@ -233,7 +230,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
/* restore values */ /* restore values */
wrmsr(MSR_TMTA_LONGRUN_CTRL, save_lo, save_hi); wrmsr(MSR_TMTA_LONGRUN_CTRL, save_lo, save_hi);
} }
dprintk("percentage is %u %%, freq is %u MHz\n", ecx, eax); pr_debug("percentage is %u %%, freq is %u MHz\n", ecx, eax);
/* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq) /* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq)
* eqals * eqals
...@@ -249,7 +246,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq, ...@@ -249,7 +246,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
edx = ((eax - ebx) * 100) / (100 - ecx); edx = ((eax - ebx) * 100) / (100 - ecx);
*low_freq = edx * 1000; /* back to kHz */ *low_freq = edx * 1000; /* back to kHz */
dprintk("low frequency is %u kHz\n", *low_freq); pr_debug("low frequency is %u kHz\n", *low_freq);
if (*low_freq > *high_freq) if (*low_freq > *high_freq)
*low_freq = *high_freq; *low_freq = *high_freq;
......
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include "speedstep-lib.h" #include "speedstep-lib.h"
#define PFX "p4-clockmod: " #define PFX "p4-clockmod: "
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"p4-clockmod", msg)
/* /*
* Duty Cycle (3bits), note DC_DISABLE is not specified in * Duty Cycle (3bits), note DC_DISABLE is not specified in
...@@ -66,7 +64,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate) ...@@ -66,7 +64,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h); rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h);
if (l & 0x01) if (l & 0x01)
dprintk("CPU#%d currently thermal throttled\n", cpu); pr_debug("CPU#%d currently thermal throttled\n", cpu);
if (has_N44_O17_errata[cpu] && if (has_N44_O17_errata[cpu] &&
(newstate == DC_25PT || newstate == DC_DFLT)) (newstate == DC_25PT || newstate == DC_DFLT))
...@@ -74,10 +72,10 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate) ...@@ -74,10 +72,10 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, &l, &h); rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, &l, &h);
if (newstate == DC_DISABLE) { if (newstate == DC_DISABLE) {
dprintk("CPU#%d disabling modulation\n", cpu); pr_debug("CPU#%d disabling modulation\n", cpu);
wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, l & ~(1<<4), h); wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, l & ~(1<<4), h);
} else { } else {
dprintk("CPU#%d setting duty cycle to %d%%\n", pr_debug("CPU#%d setting duty cycle to %d%%\n",
cpu, ((125 * newstate) / 10)); cpu, ((125 * newstate) / 10));
/* bits 63 - 5 : reserved /* bits 63 - 5 : reserved
* bit 4 : enable/disable * bit 4 : enable/disable
...@@ -217,7 +215,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy) ...@@ -217,7 +215,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
case 0x0f11: case 0x0f11:
case 0x0f12: case 0x0f12:
has_N44_O17_errata[policy->cpu] = 1; has_N44_O17_errata[policy->cpu] = 1;
dprintk("has errata -- disabling low frequencies\n"); pr_debug("has errata -- disabling low frequencies\n");
} }
if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4D && if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4D &&
......
...@@ -48,9 +48,6 @@ ...@@ -48,9 +48,6 @@
#define BUF_SZ 4 #define BUF_SZ 4
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"pcc-cpufreq", msg)
struct pcc_register_resource { struct pcc_register_resource {
u8 descriptor; u8 descriptor;
u16 length; u16 length;
...@@ -152,7 +149,7 @@ static unsigned int pcc_get_freq(unsigned int cpu) ...@@ -152,7 +149,7 @@ static unsigned int pcc_get_freq(unsigned int cpu)
spin_lock(&pcc_lock); spin_lock(&pcc_lock);
dprintk("get: get_freq for CPU %d\n", cpu); pr_debug("get: get_freq for CPU %d\n", cpu);
pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu); pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu);
input_buffer = 0x1; input_buffer = 0x1;
...@@ -170,7 +167,7 @@ static unsigned int pcc_get_freq(unsigned int cpu) ...@@ -170,7 +167,7 @@ static unsigned int pcc_get_freq(unsigned int cpu)
status = ioread16(&pcch_hdr->status); status = ioread16(&pcch_hdr->status);
if (status != CMD_COMPLETE) { if (status != CMD_COMPLETE) {
dprintk("get: FAILED: for CPU %d, status is %d\n", pr_debug("get: FAILED: for CPU %d, status is %d\n",
cpu, status); cpu, status);
goto cmd_incomplete; goto cmd_incomplete;
} }
...@@ -178,14 +175,14 @@ static unsigned int pcc_get_freq(unsigned int cpu) ...@@ -178,14 +175,14 @@ static unsigned int pcc_get_freq(unsigned int cpu)
curr_freq = (((ioread32(&pcch_hdr->nominal) * (output_buffer & 0xff)) curr_freq = (((ioread32(&pcch_hdr->nominal) * (output_buffer & 0xff))
/ 100) * 1000); / 100) * 1000);
dprintk("get: SUCCESS: (virtual) output_offset for cpu %d is " pr_debug("get: SUCCESS: (virtual) output_offset for cpu %d is "
"0x%x, contains a value of: 0x%x. Speed is: %d MHz\n", "0x%p, contains a value of: 0x%x. Speed is: %d MHz\n",
cpu, (pcch_virt_addr + pcc_cpu_data->output_offset), cpu, (pcch_virt_addr + pcc_cpu_data->output_offset),
output_buffer, curr_freq); output_buffer, curr_freq);
freq_limit = (output_buffer >> 8) & 0xff; freq_limit = (output_buffer >> 8) & 0xff;
if (freq_limit != 0xff) { if (freq_limit != 0xff) {
dprintk("get: frequency for cpu %d is being temporarily" pr_debug("get: frequency for cpu %d is being temporarily"
" capped at %d\n", cpu, curr_freq); " capped at %d\n", cpu, curr_freq);
} }
...@@ -212,8 +209,8 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy, ...@@ -212,8 +209,8 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
cpu = policy->cpu; cpu = policy->cpu;
pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu); pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu);
dprintk("target: CPU %d should go to target freq: %d " pr_debug("target: CPU %d should go to target freq: %d "
"(virtual) input_offset is 0x%x\n", "(virtual) input_offset is 0x%p\n",
cpu, target_freq, cpu, target_freq,
(pcch_virt_addr + pcc_cpu_data->input_offset)); (pcch_virt_addr + pcc_cpu_data->input_offset));
...@@ -234,14 +231,14 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy, ...@@ -234,14 +231,14 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
status = ioread16(&pcch_hdr->status); status = ioread16(&pcch_hdr->status);
if (status != CMD_COMPLETE) { if (status != CMD_COMPLETE) {
dprintk("target: FAILED for cpu %d, with status: 0x%x\n", pr_debug("target: FAILED for cpu %d, with status: 0x%x\n",
cpu, status); cpu, status);
goto cmd_incomplete; goto cmd_incomplete;
} }
iowrite16(0, &pcch_hdr->status); iowrite16(0, &pcch_hdr->status);
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
dprintk("target: was SUCCESSFUL for cpu %d\n", cpu); pr_debug("target: was SUCCESSFUL for cpu %d\n", cpu);
spin_unlock(&pcc_lock); spin_unlock(&pcc_lock);
return 0; return 0;
...@@ -293,7 +290,7 @@ static int pcc_get_offset(int cpu) ...@@ -293,7 +290,7 @@ static int pcc_get_offset(int cpu)
memset_io((pcch_virt_addr + pcc_cpu_data->input_offset), 0, BUF_SZ); memset_io((pcch_virt_addr + pcc_cpu_data->input_offset), 0, BUF_SZ);
memset_io((pcch_virt_addr + pcc_cpu_data->output_offset), 0, BUF_SZ); memset_io((pcch_virt_addr + pcc_cpu_data->output_offset), 0, BUF_SZ);
dprintk("pcc_get_offset: for CPU %d: pcc_cpu_data " pr_debug("pcc_get_offset: for CPU %d: pcc_cpu_data "
"input_offset: 0x%x, pcc_cpu_data output_offset: 0x%x\n", "input_offset: 0x%x, pcc_cpu_data output_offset: 0x%x\n",
cpu, pcc_cpu_data->input_offset, pcc_cpu_data->output_offset); cpu, pcc_cpu_data->input_offset, pcc_cpu_data->output_offset);
out_free: out_free:
...@@ -410,7 +407,7 @@ static int __init pcc_cpufreq_probe(void) ...@@ -410,7 +407,7 @@ static int __init pcc_cpufreq_probe(void)
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
ret = pcc_cpufreq_do_osc(&osc_handle); ret = pcc_cpufreq_do_osc(&osc_handle);
if (ret) if (ret)
dprintk("probe: _OSC evaluation did not succeed\n"); pr_debug("probe: _OSC evaluation did not succeed\n");
/* Firmware's use of _OSC is optional */ /* Firmware's use of _OSC is optional */
ret = 0; ret = 0;
} }
...@@ -433,7 +430,7 @@ static int __init pcc_cpufreq_probe(void) ...@@ -433,7 +430,7 @@ static int __init pcc_cpufreq_probe(void)
mem_resource = (struct pcc_memory_resource *)member->buffer.pointer; mem_resource = (struct pcc_memory_resource *)member->buffer.pointer;
dprintk("probe: mem_resource descriptor: 0x%x," pr_debug("probe: mem_resource descriptor: 0x%x,"
" length: %d, space_id: %d, resource_usage: %d," " length: %d, space_id: %d, resource_usage: %d,"
" type_specific: %d, granularity: 0x%llx," " type_specific: %d, granularity: 0x%llx,"
" minimum: 0x%llx, maximum: 0x%llx," " minimum: 0x%llx, maximum: 0x%llx,"
...@@ -453,13 +450,13 @@ static int __init pcc_cpufreq_probe(void) ...@@ -453,13 +450,13 @@ static int __init pcc_cpufreq_probe(void)
pcch_virt_addr = ioremap_nocache(mem_resource->minimum, pcch_virt_addr = ioremap_nocache(mem_resource->minimum,
mem_resource->address_length); mem_resource->address_length);
if (pcch_virt_addr == NULL) { if (pcch_virt_addr == NULL) {
dprintk("probe: could not map shared mem region\n"); pr_debug("probe: could not map shared mem region\n");
goto out_free; goto out_free;
} }
pcch_hdr = pcch_virt_addr; pcch_hdr = pcch_virt_addr;
dprintk("probe: PCCH header (virtual) addr: 0x%p\n", pcch_hdr); pr_debug("probe: PCCH header (virtual) addr: 0x%p\n", pcch_hdr);
dprintk("probe: PCCH header is at physical address: 0x%llx," pr_debug("probe: PCCH header is at physical address: 0x%llx,"
" signature: 0x%x, length: %d bytes, major: %d, minor: %d," " signature: 0x%x, length: %d bytes, major: %d, minor: %d,"
" supported features: 0x%x, command field: 0x%x," " supported features: 0x%x, command field: 0x%x,"
" status field: 0x%x, nominal latency: %d us\n", " status field: 0x%x, nominal latency: %d us\n",
...@@ -469,7 +466,7 @@ static int __init pcc_cpufreq_probe(void) ...@@ -469,7 +466,7 @@ static int __init pcc_cpufreq_probe(void)
ioread16(&pcch_hdr->command), ioread16(&pcch_hdr->status), ioread16(&pcch_hdr->command), ioread16(&pcch_hdr->status),
ioread32(&pcch_hdr->latency)); ioread32(&pcch_hdr->latency));
dprintk("probe: min time between commands: %d us," pr_debug("probe: min time between commands: %d us,"
" max time between commands: %d us," " max time between commands: %d us,"
" nominal CPU frequency: %d MHz," " nominal CPU frequency: %d MHz,"
" minimum CPU frequency: %d MHz," " minimum CPU frequency: %d MHz,"
...@@ -494,7 +491,7 @@ static int __init pcc_cpufreq_probe(void) ...@@ -494,7 +491,7 @@ static int __init pcc_cpufreq_probe(void)
doorbell.access_width = 64; doorbell.access_width = 64;
doorbell.address = reg_resource->address; doorbell.address = reg_resource->address;
dprintk("probe: doorbell: space_id is %d, bit_width is %d, " pr_debug("probe: doorbell: space_id is %d, bit_width is %d, "
"bit_offset is %d, access_width is %d, address is 0x%llx\n", "bit_offset is %d, access_width is %d, address is 0x%llx\n",
doorbell.space_id, doorbell.bit_width, doorbell.bit_offset, doorbell.space_id, doorbell.bit_width, doorbell.bit_offset,
doorbell.access_width, reg_resource->address); doorbell.access_width, reg_resource->address);
...@@ -515,7 +512,7 @@ static int __init pcc_cpufreq_probe(void) ...@@ -515,7 +512,7 @@ static int __init pcc_cpufreq_probe(void)
doorbell_write = member->integer.value; doorbell_write = member->integer.value;
dprintk("probe: doorbell_preserve: 0x%llx," pr_debug("probe: doorbell_preserve: 0x%llx,"
" doorbell_write: 0x%llx\n", " doorbell_write: 0x%llx\n",
doorbell_preserve, doorbell_write); doorbell_preserve, doorbell_write);
...@@ -550,7 +547,7 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -550,7 +547,7 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
result = pcc_get_offset(cpu); result = pcc_get_offset(cpu);
if (result) { if (result) {
dprintk("init: PCCP evaluation failed\n"); pr_debug("init: PCCP evaluation failed\n");
goto out; goto out;
} }
...@@ -561,12 +558,12 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -561,12 +558,12 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
policy->cur = pcc_get_freq(cpu); policy->cur = pcc_get_freq(cpu);
if (!policy->cur) { if (!policy->cur) {
dprintk("init: Unable to get current CPU frequency\n"); pr_debug("init: Unable to get current CPU frequency\n");
result = -EINVAL; result = -EINVAL;
goto out; goto out;
} }
dprintk("init: policy->max is %d, policy->min is %d\n", pr_debug("init: policy->max is %d, policy->min is %d\n",
policy->max, policy->min); policy->max, policy->min);
out: out:
return result; return result;
...@@ -597,7 +594,7 @@ static int __init pcc_cpufreq_init(void) ...@@ -597,7 +594,7 @@ static int __init pcc_cpufreq_init(void)
ret = pcc_cpufreq_probe(); ret = pcc_cpufreq_probe();
if (ret) { if (ret) {
dprintk("pcc_cpufreq_init: PCCH evaluation failed\n"); pr_debug("pcc_cpufreq_init: PCCH evaluation failed\n");
return ret; return ret;
} }
......
...@@ -68,7 +68,6 @@ union powernow_acpi_control_t { ...@@ -68,7 +68,6 @@ union powernow_acpi_control_t {
}; };
#endif #endif
#ifdef CONFIG_CPU_FREQ_DEBUG
/* divide by 1000 to get VCore voltage in V. */ /* divide by 1000 to get VCore voltage in V. */
static const int mobile_vid_table[32] = { static const int mobile_vid_table[32] = {
2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650,
...@@ -76,7 +75,6 @@ static const int mobile_vid_table[32] = { ...@@ -76,7 +75,6 @@ static const int mobile_vid_table[32] = {
1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100,
1075, 1050, 1025, 1000, 975, 950, 925, 0, 1075, 1050, 1025, 1000, 975, 950, 925, 0,
}; };
#endif
/* divide by 10 to get FID. */ /* divide by 10 to get FID. */
static const int fid_codes[32] = { static const int fid_codes[32] = {
...@@ -103,9 +101,6 @@ static unsigned int fsb; ...@@ -103,9 +101,6 @@ static unsigned int fsb;
static unsigned int latency; static unsigned int latency;
static char have_a0; static char have_a0;
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"powernow-k7", msg)
static int check_fsb(unsigned int fsbspeed) static int check_fsb(unsigned int fsbspeed)
{ {
int delta; int delta;
...@@ -209,7 +204,7 @@ static int get_ranges(unsigned char *pst) ...@@ -209,7 +204,7 @@ static int get_ranges(unsigned char *pst)
vid = *pst++; vid = *pst++;
powernow_table[j].index |= (vid << 8); /* upper 8 bits */ powernow_table[j].index |= (vid << 8); /* upper 8 bits */
dprintk(" FID: 0x%x (%d.%dx [%dMHz]) " pr_debug(" FID: 0x%x (%d.%dx [%dMHz]) "
"VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
fid_codes[fid] % 10, speed/1000, vid, fid_codes[fid] % 10, speed/1000, vid,
mobile_vid_table[vid]/1000, mobile_vid_table[vid]/1000,
...@@ -367,7 +362,7 @@ static int powernow_acpi_init(void) ...@@ -367,7 +362,7 @@ static int powernow_acpi_init(void)
unsigned int speed, speed_mhz; unsigned int speed, speed_mhz;
pc.val = (unsigned long) state->control; pc.val = (unsigned long) state->control;
dprintk("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", pr_debug("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n",
i, i,
(u32) state->core_frequency, (u32) state->core_frequency,
(u32) state->power, (u32) state->power,
...@@ -401,7 +396,7 @@ static int powernow_acpi_init(void) ...@@ -401,7 +396,7 @@ static int powernow_acpi_init(void)
invalidate_entry(i); invalidate_entry(i);
} }
dprintk(" FID: 0x%x (%d.%dx [%dMHz]) " pr_debug(" FID: 0x%x (%d.%dx [%dMHz]) "
"VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
fid_codes[fid] % 10, speed_mhz, vid, fid_codes[fid] % 10, speed_mhz, vid,
mobile_vid_table[vid]/1000, mobile_vid_table[vid]/1000,
...@@ -409,7 +404,7 @@ static int powernow_acpi_init(void) ...@@ -409,7 +404,7 @@ static int powernow_acpi_init(void)
if (state->core_frequency != speed_mhz) { if (state->core_frequency != speed_mhz) {
state->core_frequency = speed_mhz; state->core_frequency = speed_mhz;
dprintk(" Corrected ACPI frequency to %d\n", pr_debug(" Corrected ACPI frequency to %d\n",
speed_mhz); speed_mhz);
} }
...@@ -453,8 +448,8 @@ static int powernow_acpi_init(void) ...@@ -453,8 +448,8 @@ static int powernow_acpi_init(void)
static void print_pst_entry(struct pst_s *pst, unsigned int j) static void print_pst_entry(struct pst_s *pst, unsigned int j)
{ {
dprintk("PST:%d (@%p)\n", j, pst); pr_debug("PST:%d (@%p)\n", j, pst);
dprintk(" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n", pr_debug(" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n",
pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid); pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid);
} }
...@@ -474,20 +469,20 @@ static int powernow_decode_bios(int maxfid, int startvid) ...@@ -474,20 +469,20 @@ static int powernow_decode_bios(int maxfid, int startvid)
p = phys_to_virt(i); p = phys_to_virt(i);
if (memcmp(p, "AMDK7PNOW!", 10) == 0) { if (memcmp(p, "AMDK7PNOW!", 10) == 0) {
dprintk("Found PSB header at %p\n", p); pr_debug("Found PSB header at %p\n", p);
psb = (struct psb_s *) p; psb = (struct psb_s *) p;
dprintk("Table version: 0x%x\n", psb->tableversion); pr_debug("Table version: 0x%x\n", psb->tableversion);
if (psb->tableversion != 0x12) { if (psb->tableversion != 0x12) {
printk(KERN_INFO PFX "Sorry, only v1.2 tables" printk(KERN_INFO PFX "Sorry, only v1.2 tables"
" supported right now\n"); " supported right now\n");
return -ENODEV; return -ENODEV;
} }
dprintk("Flags: 0x%x\n", psb->flags); pr_debug("Flags: 0x%x\n", psb->flags);
if ((psb->flags & 1) == 0) if ((psb->flags & 1) == 0)
dprintk("Mobile voltage regulator\n"); pr_debug("Mobile voltage regulator\n");
else else
dprintk("Desktop voltage regulator\n"); pr_debug("Desktop voltage regulator\n");
latency = psb->settlingtime; latency = psb->settlingtime;
if (latency < 100) { if (latency < 100) {
...@@ -497,9 +492,9 @@ static int powernow_decode_bios(int maxfid, int startvid) ...@@ -497,9 +492,9 @@ static int powernow_decode_bios(int maxfid, int startvid)
"Correcting.\n", latency); "Correcting.\n", latency);
latency = 100; latency = 100;
} }
dprintk("Settling Time: %d microseconds.\n", pr_debug("Settling Time: %d microseconds.\n",
psb->settlingtime); psb->settlingtime);
dprintk("Has %d PST tables. (Only dumping ones " pr_debug("Has %d PST tables. (Only dumping ones "
"relevant to this CPU).\n", "relevant to this CPU).\n",
psb->numpst); psb->numpst);
...@@ -650,7 +645,7 @@ static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy) ...@@ -650,7 +645,7 @@ static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy)
printk(KERN_WARNING PFX "can not determine bus frequency\n"); printk(KERN_WARNING PFX "can not determine bus frequency\n");
return -EINVAL; return -EINVAL;
} }
dprintk("FSB: %3dMHz\n", fsb/1000); pr_debug("FSB: %3dMHz\n", fsb/1000);
if (dmi_check_system(powernow_dmi_table) || acpi_force) { if (dmi_check_system(powernow_dmi_table) || acpi_force) {
printk(KERN_INFO PFX "PSB/PST known to be broken. " printk(KERN_INFO PFX "PSB/PST known to be broken. "
......
This diff is collapsed.
...@@ -211,8 +211,6 @@ struct pst_s { ...@@ -211,8 +211,6 @@ struct pst_s {
u8 vid; u8 vid;
}; };
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg)
static int core_voltage_pre_transition(struct powernow_k8_data *data, static int core_voltage_pre_transition(struct powernow_k8_data *data,
u32 reqvid, u32 regfid); u32 reqvid, u32 regfid);
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);
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
static __u8 __iomem *cpuctl; static __u8 __iomem *cpuctl;
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"sc520_freq", msg)
#define PFX "sc520_freq: " #define PFX "sc520_freq: "
static struct cpufreq_frequency_table sc520_freq_table[] = { static struct cpufreq_frequency_table sc520_freq_table[] = {
...@@ -66,7 +64,7 @@ static void sc520_freq_set_cpu_state(unsigned int state) ...@@ -66,7 +64,7 @@ static void sc520_freq_set_cpu_state(unsigned int state)
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
dprintk("attempting to set frequency to %i kHz\n", pr_debug("attempting to set frequency to %i kHz\n",
sc520_freq_table[state].frequency); sc520_freq_table[state].frequency);
local_irq_disable(); local_irq_disable();
...@@ -161,7 +159,7 @@ static int __init sc520_freq_init(void) ...@@ -161,7 +159,7 @@ static int __init sc520_freq_init(void)
/* Test if we have the right hardware */ /* Test if we have the right hardware */
if (c->x86_vendor != X86_VENDOR_AMD || if (c->x86_vendor != X86_VENDOR_AMD ||
c->x86 != 4 || c->x86_model != 9) { c->x86 != 4 || c->x86_model != 9) {
dprintk("no Elan SC520 processor found!\n"); pr_debug("no Elan SC520 processor found!\n");
return -ENODEV; return -ENODEV;
} }
cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1); cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1);
......
...@@ -29,9 +29,6 @@ ...@@ -29,9 +29,6 @@
#define PFX "speedstep-centrino: " #define PFX "speedstep-centrino: "
#define MAINTAINER "cpufreq@vger.kernel.org" #define MAINTAINER "cpufreq@vger.kernel.org"
#define dprintk(msg...) \
cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg)
#define INTEL_MSR_RANGE (0xffff) #define INTEL_MSR_RANGE (0xffff)
struct cpu_id struct cpu_id
...@@ -244,7 +241,7 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy) ...@@ -244,7 +241,7 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy)
if (model->cpu_id == NULL) { if (model->cpu_id == NULL) {
/* No match at all */ /* No match at all */
dprintk("no support for CPU model \"%s\": " pr_debug("no support for CPU model \"%s\": "
"send /proc/cpuinfo to " MAINTAINER "\n", "send /proc/cpuinfo to " MAINTAINER "\n",
cpu->x86_model_id); cpu->x86_model_id);
return -ENOENT; return -ENOENT;
...@@ -252,15 +249,15 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy) ...@@ -252,15 +249,15 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy)
if (model->op_points == NULL) { if (model->op_points == NULL) {
/* Matched a non-match */ /* Matched a non-match */
dprintk("no table support for CPU model \"%s\"\n", pr_debug("no table support for CPU model \"%s\"\n",
cpu->x86_model_id); cpu->x86_model_id);
dprintk("try using the acpi-cpufreq driver\n"); pr_debug("try using the acpi-cpufreq driver\n");
return -ENOENT; return -ENOENT;
} }
per_cpu(centrino_model, policy->cpu) = model; per_cpu(centrino_model, policy->cpu) = model;
dprintk("found \"%s\": max frequency: %dkHz\n", pr_debug("found \"%s\": max frequency: %dkHz\n",
model->model_name, model->max_freq); model->model_name, model->max_freq);
return 0; return 0;
...@@ -369,7 +366,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) ...@@ -369,7 +366,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
per_cpu(centrino_cpu, policy->cpu) = &cpu_ids[i]; per_cpu(centrino_cpu, policy->cpu) = &cpu_ids[i];
if (!per_cpu(centrino_cpu, policy->cpu)) { if (!per_cpu(centrino_cpu, policy->cpu)) {
dprintk("found unsupported CPU with " pr_debug("found unsupported CPU with "
"Enhanced SpeedStep: send /proc/cpuinfo to " "Enhanced SpeedStep: send /proc/cpuinfo to "
MAINTAINER "\n"); MAINTAINER "\n");
return -ENODEV; return -ENODEV;
...@@ -385,7 +382,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) ...@@ -385,7 +382,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
if (!(l & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) { if (!(l & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
l |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP; l |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP;
dprintk("trying to enable Enhanced SpeedStep (%x)\n", l); pr_debug("trying to enable Enhanced SpeedStep (%x)\n", l);
wrmsr(MSR_IA32_MISC_ENABLE, l, h); wrmsr(MSR_IA32_MISC_ENABLE, l, h);
/* check to see if it stuck */ /* check to see if it stuck */
...@@ -402,7 +399,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) ...@@ -402,7 +399,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
/* 10uS transition latency */ /* 10uS transition latency */
policy->cur = freq; policy->cur = freq;
dprintk("centrino_cpu_init: cur=%dkHz\n", policy->cur); pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur);
ret = cpufreq_frequency_table_cpuinfo(policy, ret = cpufreq_frequency_table_cpuinfo(policy,
per_cpu(centrino_model, policy->cpu)->op_points); per_cpu(centrino_model, policy->cpu)->op_points);
...@@ -498,7 +495,7 @@ static int centrino_target (struct cpufreq_policy *policy, ...@@ -498,7 +495,7 @@ static int centrino_target (struct cpufreq_policy *policy,
good_cpu = j; good_cpu = j;
if (good_cpu >= nr_cpu_ids) { if (good_cpu >= nr_cpu_ids) {
dprintk("couldn't limit to CPUs in this domain\n"); pr_debug("couldn't limit to CPUs in this domain\n");
retval = -EAGAIN; retval = -EAGAIN;
if (first_cpu) { if (first_cpu) {
/* We haven't started the transition yet. */ /* We haven't started the transition yet. */
...@@ -512,7 +509,7 @@ static int centrino_target (struct cpufreq_policy *policy, ...@@ -512,7 +509,7 @@ static int centrino_target (struct cpufreq_policy *policy,
if (first_cpu) { if (first_cpu) {
rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h); rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h);
if (msr == (oldmsr & 0xffff)) { if (msr == (oldmsr & 0xffff)) {
dprintk("no change needed - msr was and needs " pr_debug("no change needed - msr was and needs "
"to be %x\n", oldmsr); "to be %x\n", oldmsr);
retval = 0; retval = 0;
goto out; goto out;
...@@ -521,7 +518,7 @@ static int centrino_target (struct cpufreq_policy *policy, ...@@ -521,7 +518,7 @@ static int centrino_target (struct cpufreq_policy *policy,
freqs.old = extract_clock(oldmsr, cpu, 0); freqs.old = extract_clock(oldmsr, cpu, 0);
freqs.new = extract_clock(msr, cpu, 0); freqs.new = extract_clock(msr, cpu, 0);
dprintk("target=%dkHz old=%d new=%d msr=%04x\n", pr_debug("target=%dkHz old=%d new=%d msr=%04x\n",
target_freq, freqs.old, freqs.new, msr); target_freq, freqs.old, freqs.new, msr);
for_each_cpu(k, policy->cpus) { for_each_cpu(k, policy->cpus) {
......
...@@ -53,10 +53,6 @@ static struct cpufreq_frequency_table speedstep_freqs[] = { ...@@ -53,10 +53,6 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
}; };
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"speedstep-ich", msg)
/** /**
* speedstep_find_register - read the PMBASE address * speedstep_find_register - read the PMBASE address
* *
...@@ -80,7 +76,7 @@ static int speedstep_find_register(void) ...@@ -80,7 +76,7 @@ static int speedstep_find_register(void)
return -ENODEV; return -ENODEV;
} }
dprintk("pmbase is 0x%x\n", pmbase); pr_debug("pmbase is 0x%x\n", pmbase);
return 0; return 0;
} }
...@@ -106,13 +102,13 @@ static void speedstep_set_state(unsigned int state) ...@@ -106,13 +102,13 @@ static void speedstep_set_state(unsigned int state)
/* read state */ /* read state */
value = inb(pmbase + 0x50); value = inb(pmbase + 0x50);
dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); pr_debug("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value);
/* write new state */ /* write new state */
value &= 0xFE; value &= 0xFE;
value |= state; value |= state;
dprintk("writing 0x%x to pmbase 0x%x + 0x50\n", value, pmbase); pr_debug("writing 0x%x to pmbase 0x%x + 0x50\n", value, pmbase);
/* Disable bus master arbitration */ /* Disable bus master arbitration */
pm2_blk = inb(pmbase + 0x20); pm2_blk = inb(pmbase + 0x20);
...@@ -132,10 +128,10 @@ static void speedstep_set_state(unsigned int state) ...@@ -132,10 +128,10 @@ static void speedstep_set_state(unsigned int state)
/* Enable IRQs */ /* Enable IRQs */
local_irq_restore(flags); local_irq_restore(flags);
dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); pr_debug("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value);
if (state == (value & 0x1)) if (state == (value & 0x1))
dprintk("change to %u MHz succeeded\n", pr_debug("change to %u MHz succeeded\n",
speedstep_get_frequency(speedstep_processor) / 1000); speedstep_get_frequency(speedstep_processor) / 1000);
else else
printk(KERN_ERR "cpufreq: change failed - I/O error\n"); printk(KERN_ERR "cpufreq: change failed - I/O error\n");
...@@ -165,7 +161,7 @@ static int speedstep_activate(void) ...@@ -165,7 +161,7 @@ static int speedstep_activate(void)
pci_read_config_word(speedstep_chipset_dev, 0x00A0, &value); pci_read_config_word(speedstep_chipset_dev, 0x00A0, &value);
if (!(value & 0x08)) { if (!(value & 0x08)) {
value |= 0x08; value |= 0x08;
dprintk("activating SpeedStep (TM) registers\n"); pr_debug("activating SpeedStep (TM) registers\n");
pci_write_config_word(speedstep_chipset_dev, 0x00A0, value); pci_write_config_word(speedstep_chipset_dev, 0x00A0, value);
} }
...@@ -218,7 +214,7 @@ static unsigned int speedstep_detect_chipset(void) ...@@ -218,7 +214,7 @@ static unsigned int speedstep_detect_chipset(void)
return 2; /* 2-M */ return 2; /* 2-M */
if (hostbridge->revision < 5) { if (hostbridge->revision < 5) {
dprintk("hostbridge does not support speedstep\n"); pr_debug("hostbridge does not support speedstep\n");
speedstep_chipset_dev = NULL; speedstep_chipset_dev = NULL;
pci_dev_put(hostbridge); pci_dev_put(hostbridge);
return 0; return 0;
...@@ -246,7 +242,7 @@ static unsigned int speedstep_get(unsigned int cpu) ...@@ -246,7 +242,7 @@ static unsigned int speedstep_get(unsigned int cpu)
if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0) if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
BUG(); BUG();
dprintk("detected %u kHz as current frequency\n", speed); pr_debug("detected %u kHz as current frequency\n", speed);
return speed; return speed;
} }
...@@ -276,7 +272,7 @@ static int speedstep_target(struct cpufreq_policy *policy, ...@@ -276,7 +272,7 @@ static int speedstep_target(struct cpufreq_policy *policy,
freqs.new = speedstep_freqs[newstate].frequency; freqs.new = speedstep_freqs[newstate].frequency;
freqs.cpu = policy->cpu; freqs.cpu = policy->cpu;
dprintk("transiting from %u to %u kHz\n", freqs.old, freqs.new); pr_debug("transiting from %u to %u kHz\n", freqs.old, freqs.new);
/* no transition necessary */ /* no transition necessary */
if (freqs.old == freqs.new) if (freqs.old == freqs.new)
...@@ -351,7 +347,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -351,7 +347,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
if (!speed) if (!speed)
return -EIO; return -EIO;
dprintk("currently at %s speed setting - %i MHz\n", pr_debug("currently at %s speed setting - %i MHz\n",
(speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
? "low" : "high", ? "low" : "high",
(speed / 1000)); (speed / 1000));
...@@ -405,14 +401,14 @@ static int __init speedstep_init(void) ...@@ -405,14 +401,14 @@ static int __init speedstep_init(void)
/* detect processor */ /* detect processor */
speedstep_processor = speedstep_detect_processor(); speedstep_processor = speedstep_detect_processor();
if (!speedstep_processor) { if (!speedstep_processor) {
dprintk("Intel(R) SpeedStep(TM) capable processor " pr_debug("Intel(R) SpeedStep(TM) capable processor "
"not found\n"); "not found\n");
return -ENODEV; return -ENODEV;
} }
/* detect chipset */ /* detect chipset */
if (!speedstep_detect_chipset()) { if (!speedstep_detect_chipset()) {
dprintk("Intel(R) SpeedStep(TM) for this chipset not " pr_debug("Intel(R) SpeedStep(TM) for this chipset not "
"(yet) available.\n"); "(yet) available.\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
#include <asm/tsc.h> #include <asm/tsc.h>
#include "speedstep-lib.h" #include "speedstep-lib.h"
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"speedstep-lib", msg)
#define PFX "speedstep-lib: " #define PFX "speedstep-lib: "
#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK #ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
...@@ -75,7 +72,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor) ...@@ -75,7 +72,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
/* read MSR 0x2a - we only need the low 32 bits */ /* read MSR 0x2a - we only need the low 32 bits */
rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
dprintk("P3 - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); pr_debug("P3 - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp);
msr_tmp = msr_lo; msr_tmp = msr_lo;
/* decode the FSB */ /* decode the FSB */
...@@ -89,7 +86,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor) ...@@ -89,7 +86,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
/* decode the multiplier */ /* decode the multiplier */
if (processor == SPEEDSTEP_CPU_PIII_C_EARLY) { if (processor == SPEEDSTEP_CPU_PIII_C_EARLY) {
dprintk("workaround for early PIIIs\n"); pr_debug("workaround for early PIIIs\n");
msr_lo &= 0x03c00000; msr_lo &= 0x03c00000;
} else } else
msr_lo &= 0x0bc00000; msr_lo &= 0x0bc00000;
...@@ -100,7 +97,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor) ...@@ -100,7 +97,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
j++; j++;
} }
dprintk("speed is %u\n", pr_debug("speed is %u\n",
(msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100)); (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100));
return msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100; return msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100;
...@@ -112,7 +109,7 @@ static unsigned int pentiumM_get_frequency(void) ...@@ -112,7 +109,7 @@ static unsigned int pentiumM_get_frequency(void)
u32 msr_lo, msr_tmp; u32 msr_lo, msr_tmp;
rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
dprintk("PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); pr_debug("PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp);
/* see table B-2 of 24547212.pdf */ /* see table B-2 of 24547212.pdf */
if (msr_lo & 0x00040000) { if (msr_lo & 0x00040000) {
...@@ -122,7 +119,7 @@ static unsigned int pentiumM_get_frequency(void) ...@@ -122,7 +119,7 @@ static unsigned int pentiumM_get_frequency(void)
} }
msr_tmp = (msr_lo >> 22) & 0x1f; msr_tmp = (msr_lo >> 22) & 0x1f;
dprintk("bits 22-26 are 0x%x, speed is %u\n", pr_debug("bits 22-26 are 0x%x, speed is %u\n",
msr_tmp, (msr_tmp * 100 * 1000)); msr_tmp, (msr_tmp * 100 * 1000));
return msr_tmp * 100 * 1000; return msr_tmp * 100 * 1000;
...@@ -160,11 +157,11 @@ static unsigned int pentium_core_get_frequency(void) ...@@ -160,11 +157,11 @@ static unsigned int pentium_core_get_frequency(void)
} }
rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
dprintk("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", pr_debug("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n",
msr_lo, msr_tmp); msr_lo, msr_tmp);
msr_tmp = (msr_lo >> 22) & 0x1f; msr_tmp = (msr_lo >> 22) & 0x1f;
dprintk("bits 22-26 are 0x%x, speed is %u\n", pr_debug("bits 22-26 are 0x%x, speed is %u\n",
msr_tmp, (msr_tmp * fsb)); msr_tmp, (msr_tmp * fsb));
ret = (msr_tmp * fsb); ret = (msr_tmp * fsb);
...@@ -190,7 +187,7 @@ static unsigned int pentium4_get_frequency(void) ...@@ -190,7 +187,7 @@ static unsigned int pentium4_get_frequency(void)
rdmsr(0x2c, msr_lo, msr_hi); rdmsr(0x2c, msr_lo, msr_hi);
dprintk("P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); pr_debug("P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi);
/* decode the FSB: see IA-32 Intel (C) Architecture Software /* decode the FSB: see IA-32 Intel (C) Architecture Software
* Developer's Manual, Volume 3: System Prgramming Guide, * Developer's Manual, Volume 3: System Prgramming Guide,
...@@ -217,7 +214,7 @@ static unsigned int pentium4_get_frequency(void) ...@@ -217,7 +214,7 @@ static unsigned int pentium4_get_frequency(void)
/* Multiplier. */ /* Multiplier. */
mult = msr_lo >> 24; mult = msr_lo >> 24;
dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n", pr_debug("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n",
fsb, mult, (fsb * mult)); fsb, mult, (fsb * mult));
ret = (fsb * mult); ret = (fsb * mult);
...@@ -257,7 +254,7 @@ unsigned int speedstep_detect_processor(void) ...@@ -257,7 +254,7 @@ unsigned int speedstep_detect_processor(void)
struct cpuinfo_x86 *c = &cpu_data(0); struct cpuinfo_x86 *c = &cpu_data(0);
u32 ebx, msr_lo, msr_hi; u32 ebx, msr_lo, msr_hi;
dprintk("x86: %x, model: %x\n", c->x86, c->x86_model); pr_debug("x86: %x, model: %x\n", c->x86, c->x86_model);
if ((c->x86_vendor != X86_VENDOR_INTEL) || if ((c->x86_vendor != X86_VENDOR_INTEL) ||
((c->x86 != 6) && (c->x86 != 0xF))) ((c->x86 != 6) && (c->x86 != 0xF)))
...@@ -272,7 +269,7 @@ unsigned int speedstep_detect_processor(void) ...@@ -272,7 +269,7 @@ unsigned int speedstep_detect_processor(void)
ebx = cpuid_ebx(0x00000001); ebx = cpuid_ebx(0x00000001);
ebx &= 0x000000FF; ebx &= 0x000000FF;
dprintk("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask); pr_debug("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask);
switch (c->x86_mask) { switch (c->x86_mask) {
case 4: case 4:
...@@ -327,7 +324,7 @@ unsigned int speedstep_detect_processor(void) ...@@ -327,7 +324,7 @@ unsigned int speedstep_detect_processor(void)
/* cpuid_ebx(1) is 0x04 for desktop PIII, /* cpuid_ebx(1) is 0x04 for desktop PIII,
* 0x06 for mobile PIII-M */ * 0x06 for mobile PIII-M */
ebx = cpuid_ebx(0x00000001); ebx = cpuid_ebx(0x00000001);
dprintk("ebx is %x\n", ebx); pr_debug("ebx is %x\n", ebx);
ebx &= 0x000000FF; ebx &= 0x000000FF;
...@@ -344,7 +341,7 @@ unsigned int speedstep_detect_processor(void) ...@@ -344,7 +341,7 @@ unsigned int speedstep_detect_processor(void)
/* all mobile PIII Coppermines have FSB 100 MHz /* all mobile PIII Coppermines have FSB 100 MHz
* ==> sort out a few desktop PIIIs. */ * ==> sort out a few desktop PIIIs. */
rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi); rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi);
dprintk("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n", pr_debug("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n",
msr_lo, msr_hi); msr_lo, msr_hi);
msr_lo &= 0x00c0000; msr_lo &= 0x00c0000;
if (msr_lo != 0x0080000) if (msr_lo != 0x0080000)
...@@ -357,12 +354,12 @@ unsigned int speedstep_detect_processor(void) ...@@ -357,12 +354,12 @@ unsigned int speedstep_detect_processor(void)
* bit 56 or 57 is set * bit 56 or 57 is set
*/ */
rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi); rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi);
dprintk("Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", pr_debug("Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n",
msr_lo, msr_hi); msr_lo, msr_hi);
if ((msr_hi & (1<<18)) && if ((msr_hi & (1<<18)) &&
(relaxed_check ? 1 : (msr_hi & (3<<24)))) { (relaxed_check ? 1 : (msr_hi & (3<<24)))) {
if (c->x86_mask == 0x01) { if (c->x86_mask == 0x01) {
dprintk("early PIII version\n"); pr_debug("early PIII version\n");
return SPEEDSTEP_CPU_PIII_C_EARLY; return SPEEDSTEP_CPU_PIII_C_EARLY;
} else } else
return SPEEDSTEP_CPU_PIII_C; return SPEEDSTEP_CPU_PIII_C;
...@@ -393,14 +390,14 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor, ...@@ -393,14 +390,14 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
if ((!processor) || (!low_speed) || (!high_speed) || (!set_state)) if ((!processor) || (!low_speed) || (!high_speed) || (!set_state))
return -EINVAL; return -EINVAL;
dprintk("trying to determine both speeds\n"); pr_debug("trying to determine both speeds\n");
/* get current speed */ /* get current speed */
prev_speed = speedstep_get_frequency(processor); prev_speed = speedstep_get_frequency(processor);
if (!prev_speed) if (!prev_speed)
return -EIO; return -EIO;
dprintk("previous speed is %u\n", prev_speed); pr_debug("previous speed is %u\n", prev_speed);
local_irq_save(flags); local_irq_save(flags);
...@@ -412,7 +409,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor, ...@@ -412,7 +409,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
goto out; goto out;
} }
dprintk("low speed is %u\n", *low_speed); pr_debug("low speed is %u\n", *low_speed);
/* start latency measurement */ /* start latency measurement */
if (transition_latency) if (transition_latency)
...@@ -431,7 +428,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor, ...@@ -431,7 +428,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
goto out; goto out;
} }
dprintk("high speed is %u\n", *high_speed); pr_debug("high speed is %u\n", *high_speed);
if (*low_speed == *high_speed) { if (*low_speed == *high_speed) {
ret = -ENODEV; ret = -ENODEV;
...@@ -445,7 +442,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor, ...@@ -445,7 +442,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
if (transition_latency) { if (transition_latency) {
*transition_latency = (tv2.tv_sec - tv1.tv_sec) * USEC_PER_SEC + *transition_latency = (tv2.tv_sec - tv1.tv_sec) * USEC_PER_SEC +
tv2.tv_usec - tv1.tv_usec; tv2.tv_usec - tv1.tv_usec;
dprintk("transition latency is %u uSec\n", *transition_latency); pr_debug("transition latency is %u uSec\n", *transition_latency);
/* convert uSec to nSec and add 20% for safety reasons */ /* convert uSec to nSec and add 20% for safety reasons */
*transition_latency *= 1200; *transition_latency *= 1200;
......
...@@ -55,9 +55,6 @@ static struct cpufreq_frequency_table speedstep_freqs[] = { ...@@ -55,9 +55,6 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
* of DMA activity going on? */ * of DMA activity going on? */
#define SMI_TRIES 5 #define SMI_TRIES 5
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
"speedstep-smi", msg)
/** /**
* speedstep_smi_ownership * speedstep_smi_ownership
*/ */
...@@ -70,7 +67,7 @@ static int speedstep_smi_ownership(void) ...@@ -70,7 +67,7 @@ static int speedstep_smi_ownership(void)
command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
magic = virt_to_phys(magic_data); magic = virt_to_phys(magic_data);
dprintk("trying to obtain ownership with command %x at port %x\n", pr_debug("trying to obtain ownership with command %x at port %x\n",
command, smi_port); command, smi_port);
__asm__ __volatile__( __asm__ __volatile__(
...@@ -85,7 +82,7 @@ static int speedstep_smi_ownership(void) ...@@ -85,7 +82,7 @@ static int speedstep_smi_ownership(void)
: "memory" : "memory"
); );
dprintk("result is %x\n", result); pr_debug("result is %x\n", result);
return result; return result;
} }
...@@ -106,13 +103,13 @@ static int speedstep_smi_get_freqs(unsigned int *low, unsigned int *high) ...@@ -106,13 +103,13 @@ static int speedstep_smi_get_freqs(unsigned int *low, unsigned int *high)
u32 function = GET_SPEEDSTEP_FREQS; u32 function = GET_SPEEDSTEP_FREQS;
if (!(ist_info.event & 0xFFFF)) { if (!(ist_info.event & 0xFFFF)) {
dprintk("bug #1422 -- can't read freqs from BIOS\n"); pr_debug("bug #1422 -- can't read freqs from BIOS\n");
return -ENODEV; return -ENODEV;
} }
command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
dprintk("trying to determine frequencies with command %x at port %x\n", pr_debug("trying to determine frequencies with command %x at port %x\n",
command, smi_port); command, smi_port);
__asm__ __volatile__( __asm__ __volatile__(
...@@ -129,7 +126,7 @@ static int speedstep_smi_get_freqs(unsigned int *low, unsigned int *high) ...@@ -129,7 +126,7 @@ static int speedstep_smi_get_freqs(unsigned int *low, unsigned int *high)
"d" (smi_port), "S" (0), "D" (0) "d" (smi_port), "S" (0), "D" (0)
); );
dprintk("result %x, low_freq %u, high_freq %u\n", pr_debug("result %x, low_freq %u, high_freq %u\n",
result, low_mhz, high_mhz); result, low_mhz, high_mhz);
/* abort if results are obviously incorrect... */ /* abort if results are obviously incorrect... */
...@@ -154,7 +151,7 @@ static int speedstep_get_state(void) ...@@ -154,7 +151,7 @@ static int speedstep_get_state(void)
command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
dprintk("trying to determine current setting with command %x " pr_debug("trying to determine current setting with command %x "
"at port %x\n", command, smi_port); "at port %x\n", command, smi_port);
__asm__ __volatile__( __asm__ __volatile__(
...@@ -168,7 +165,7 @@ static int speedstep_get_state(void) ...@@ -168,7 +165,7 @@ static int speedstep_get_state(void)
"d" (smi_port), "S" (0), "D" (0) "d" (smi_port), "S" (0), "D" (0)
); );
dprintk("state is %x, result is %x\n", state, result); pr_debug("state is %x, result is %x\n", state, result);
return state & 1; return state & 1;
} }
...@@ -194,13 +191,13 @@ static void speedstep_set_state(unsigned int state) ...@@ -194,13 +191,13 @@ static void speedstep_set_state(unsigned int state)
command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
dprintk("trying to set frequency to state %u " pr_debug("trying to set frequency to state %u "
"with command %x at port %x\n", "with command %x at port %x\n",
state, command, smi_port); state, command, smi_port);
do { do {
if (retry) { if (retry) {
dprintk("retry %u, previous result %u, waiting...\n", pr_debug("retry %u, previous result %u, waiting...\n",
retry, result); retry, result);
mdelay(retry * 50); mdelay(retry * 50);
} }
...@@ -221,7 +218,7 @@ static void speedstep_set_state(unsigned int state) ...@@ -221,7 +218,7 @@ static void speedstep_set_state(unsigned int state)
local_irq_restore(flags); local_irq_restore(flags);
if (new_state == state) if (new_state == state)
dprintk("change to %u MHz succeeded after %u tries " pr_debug("change to %u MHz succeeded after %u tries "
"with result %u\n", "with result %u\n",
(speedstep_freqs[new_state].frequency / 1000), (speedstep_freqs[new_state].frequency / 1000),
retry, result); retry, result);
...@@ -292,7 +289,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -292,7 +289,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
result = speedstep_smi_ownership(); result = speedstep_smi_ownership();
if (result) { if (result) {
dprintk("fails in acquiring ownership of a SMI interface.\n"); pr_debug("fails in acquiring ownership of a SMI interface.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -304,7 +301,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -304,7 +301,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
if (result) { if (result) {
/* fall back to speedstep_lib.c dection mechanism: /* fall back to speedstep_lib.c dection mechanism:
* try both states out */ * try both states out */
dprintk("could not detect low and high frequencies " pr_debug("could not detect low and high frequencies "
"by SMI call.\n"); "by SMI call.\n");
result = speedstep_get_freqs(speedstep_processor, result = speedstep_get_freqs(speedstep_processor,
low, high, low, high,
...@@ -312,18 +309,18 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -312,18 +309,18 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
&speedstep_set_state); &speedstep_set_state);
if (result) { if (result) {
dprintk("could not detect two different speeds" pr_debug("could not detect two different speeds"
" -- aborting.\n"); " -- aborting.\n");
return result; return result;
} else } else
dprintk("workaround worked.\n"); pr_debug("workaround worked.\n");
} }
/* get current speed setting */ /* get current speed setting */
state = speedstep_get_state(); state = speedstep_get_state();
speed = speedstep_freqs[state].frequency; speed = speedstep_freqs[state].frequency;
dprintk("currently at %s speed setting - %i MHz\n", pr_debug("currently at %s speed setting - %i MHz\n",
(speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
? "low" : "high", ? "low" : "high",
(speed / 1000)); (speed / 1000));
...@@ -360,7 +357,7 @@ static int speedstep_resume(struct cpufreq_policy *policy) ...@@ -360,7 +357,7 @@ static int speedstep_resume(struct cpufreq_policy *policy)
int result = speedstep_smi_ownership(); int result = speedstep_smi_ownership();
if (result) if (result)
dprintk("fails in re-acquiring ownership of a SMI interface.\n"); pr_debug("fails in re-acquiring ownership of a SMI interface.\n");
return result; return result;
} }
...@@ -403,12 +400,12 @@ static int __init speedstep_init(void) ...@@ -403,12 +400,12 @@ static int __init speedstep_init(void)
} }
if (!speedstep_processor) { if (!speedstep_processor) {
dprintk("No supported Intel CPU detected.\n"); pr_debug("No supported Intel CPU detected.\n");
return -ENODEV; return -ENODEV;
} }
dprintk("signature:0x%.8lx, command:0x%.8lx, " pr_debug("signature:0x%.8ulx, command:0x%.8ulx, "
"event:0x%.8lx, perf_level:0x%.8lx.\n", "event:0x%.8ulx, perf_level:0x%.8ulx.\n",
ist_info.signature, ist_info.command, ist_info.signature, ist_info.command,
ist_info.event, ist_info.perf_level); ist_info.event, ist_info.perf_level);
......
...@@ -49,10 +49,6 @@ ACPI_MODULE_NAME("processor_perflib"); ...@@ -49,10 +49,6 @@ ACPI_MODULE_NAME("processor_perflib");
static DEFINE_MUTEX(performance_mutex); static DEFINE_MUTEX(performance_mutex);
/* Use cpufreq debug layer for _PPC changes. */
#define cpufreq_printk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \
"cpufreq-core", msg)
/* /*
* _PPC support is implemented as a CPUfreq policy notifier: * _PPC support is implemented as a CPUfreq policy notifier:
* This means each time a CPUfreq driver registered also with * This means each time a CPUfreq driver registered also with
...@@ -145,7 +141,7 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr) ...@@ -145,7 +141,7 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
return -ENODEV; return -ENODEV;
} }
cpufreq_printk("CPU %d: _PPC is %d - frequency %s limited\n", pr->id, pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id,
(int)ppc, ppc ? "" : "not"); (int)ppc, ppc ? "" : "not");
pr->performance_platform_limit = (int)ppc; pr->performance_platform_limit = (int)ppc;
......
...@@ -18,19 +18,6 @@ if CPU_FREQ ...@@ -18,19 +18,6 @@ if CPU_FREQ
config CPU_FREQ_TABLE config CPU_FREQ_TABLE
tristate tristate
config CPU_FREQ_DEBUG
bool "Enable CPUfreq debugging"
help
Say Y here to enable CPUfreq subsystem (including drivers)
debugging. You will need to activate it via the kernel
command line by passing
cpufreq.debug=<value>
To get <value>, add
1 to activate CPUfreq core debugging,
2 to activate CPUfreq drivers debugging, and
4 to activate CPUfreq governor debugging
config CPU_FREQ_STAT config CPU_FREQ_STAT
tristate "CPU frequency translation statistics" tristate "CPU frequency translation statistics"
select CPU_FREQ_TABLE select CPU_FREQ_TABLE
......
This diff is collapsed.
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/init.h> #include <linux/init.h>
#define dprintk(msg...) \
cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "performance", msg)
static int cpufreq_governor_performance(struct cpufreq_policy *policy, static int cpufreq_governor_performance(struct cpufreq_policy *policy,
unsigned int event) unsigned int event)
...@@ -25,7 +22,7 @@ static int cpufreq_governor_performance(struct cpufreq_policy *policy, ...@@ -25,7 +22,7 @@ static int cpufreq_governor_performance(struct cpufreq_policy *policy,
switch (event) { switch (event) {
case CPUFREQ_GOV_START: case CPUFREQ_GOV_START:
case CPUFREQ_GOV_LIMITS: case CPUFREQ_GOV_LIMITS:
dprintk("setting to %u kHz because of event %u\n", pr_debug("setting to %u kHz because of event %u\n",
policy->max, event); policy->max, event);
__cpufreq_driver_target(policy, policy->max, __cpufreq_driver_target(policy, policy->max,
CPUFREQ_RELATION_H); CPUFREQ_RELATION_H);
......
...@@ -15,16 +15,13 @@ ...@@ -15,16 +15,13 @@
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#include <linux/init.h> #include <linux/init.h>
#define dprintk(msg...) \
cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "powersave", msg)
static int cpufreq_governor_powersave(struct cpufreq_policy *policy, static int cpufreq_governor_powersave(struct cpufreq_policy *policy,
unsigned int event) unsigned int event)
{ {
switch (event) { switch (event) {
case CPUFREQ_GOV_START: case CPUFREQ_GOV_START:
case CPUFREQ_GOV_LIMITS: case CPUFREQ_GOV_LIMITS:
dprintk("setting to %u kHz because of event %u\n", pr_debug("setting to %u kHz because of event %u\n",
policy->min, event); policy->min, event);
__cpufreq_driver_target(policy, policy->min, __cpufreq_driver_target(policy, policy->min,
CPUFREQ_RELATION_L); CPUFREQ_RELATION_L);
......
...@@ -37,9 +37,6 @@ static DEFINE_PER_CPU(unsigned int, cpu_is_managed); ...@@ -37,9 +37,6 @@ static DEFINE_PER_CPU(unsigned int, cpu_is_managed);
static DEFINE_MUTEX(userspace_mutex); static DEFINE_MUTEX(userspace_mutex);
static int cpus_using_userspace_governor; static int cpus_using_userspace_governor;
#define dprintk(msg...) \
cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "userspace", msg)
/* keep track of frequency transitions */ /* keep track of frequency transitions */
static int static int
userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
...@@ -50,7 +47,7 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, ...@@ -50,7 +47,7 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
if (!per_cpu(cpu_is_managed, freq->cpu)) if (!per_cpu(cpu_is_managed, freq->cpu))
return 0; return 0;
dprintk("saving cpu_cur_freq of cpu %u to be %u kHz\n", pr_debug("saving cpu_cur_freq of cpu %u to be %u kHz\n",
freq->cpu, freq->new); freq->cpu, freq->new);
per_cpu(cpu_cur_freq, freq->cpu) = freq->new; per_cpu(cpu_cur_freq, freq->cpu) = freq->new;
...@@ -73,7 +70,7 @@ static int cpufreq_set(struct cpufreq_policy *policy, unsigned int freq) ...@@ -73,7 +70,7 @@ static int cpufreq_set(struct cpufreq_policy *policy, unsigned int freq)
{ {
int ret = -EINVAL; int ret = -EINVAL;
dprintk("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq); pr_debug("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq);
mutex_lock(&userspace_mutex); mutex_lock(&userspace_mutex);
if (!per_cpu(cpu_is_managed, policy->cpu)) if (!per_cpu(cpu_is_managed, policy->cpu))
...@@ -134,7 +131,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy, ...@@ -134,7 +131,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
per_cpu(cpu_max_freq, cpu) = policy->max; per_cpu(cpu_max_freq, cpu) = policy->max;
per_cpu(cpu_cur_freq, cpu) = policy->cur; per_cpu(cpu_cur_freq, cpu) = policy->cur;
per_cpu(cpu_set_freq, cpu) = policy->cur; per_cpu(cpu_set_freq, cpu) = policy->cur;
dprintk("managing cpu %u started " pr_debug("managing cpu %u started "
"(%u - %u kHz, currently %u kHz)\n", "(%u - %u kHz, currently %u kHz)\n",
cpu, cpu,
per_cpu(cpu_min_freq, cpu), per_cpu(cpu_min_freq, cpu),
...@@ -156,12 +153,12 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy, ...@@ -156,12 +153,12 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
per_cpu(cpu_min_freq, cpu) = 0; per_cpu(cpu_min_freq, cpu) = 0;
per_cpu(cpu_max_freq, cpu) = 0; per_cpu(cpu_max_freq, cpu) = 0;
per_cpu(cpu_set_freq, cpu) = 0; per_cpu(cpu_set_freq, cpu) = 0;
dprintk("managing cpu %u stopped\n", cpu); pr_debug("managing cpu %u stopped\n", cpu);
mutex_unlock(&userspace_mutex); mutex_unlock(&userspace_mutex);
break; break;
case CPUFREQ_GOV_LIMITS: case CPUFREQ_GOV_LIMITS:
mutex_lock(&userspace_mutex); mutex_lock(&userspace_mutex);
dprintk("limit event for cpu %u: %u - %u kHz, " pr_debug("limit event for cpu %u: %u - %u kHz, "
"currently %u kHz, last set to %u kHz\n", "currently %u kHz, last set to %u kHz\n",
cpu, policy->min, policy->max, cpu, policy->min, policy->max,
per_cpu(cpu_cur_freq, cpu), per_cpu(cpu_cur_freq, cpu),
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/cpufreq.h> #include <linux/cpufreq.h>
#define dprintk(msg...) \
cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg)
/********************************************************************* /*********************************************************************
* FREQUENCY TABLE HELPERS * * FREQUENCY TABLE HELPERS *
*********************************************************************/ *********************************************************************/
...@@ -31,11 +28,11 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy, ...@@ -31,11 +28,11 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) { for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
unsigned int freq = table[i].frequency; unsigned int freq = table[i].frequency;
if (freq == CPUFREQ_ENTRY_INVALID) { if (freq == CPUFREQ_ENTRY_INVALID) {
dprintk("table entry %u is invalid, skipping\n", i); pr_debug("table entry %u is invalid, skipping\n", i);
continue; continue;
} }
dprintk("table entry %u: %u kHz, %u index\n", pr_debug("table entry %u: %u kHz, %u index\n",
i, freq, table[i].index); i, freq, table[i].index);
if (freq < min_freq) if (freq < min_freq)
min_freq = freq; min_freq = freq;
...@@ -61,7 +58,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, ...@@ -61,7 +58,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
unsigned int i; unsigned int i;
unsigned int count = 0; unsigned int count = 0;
dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n", pr_debug("request for verification of policy (%u - %u kHz) for cpu %u\n",
policy->min, policy->max, policy->cpu); policy->min, policy->max, policy->cpu);
if (!cpu_online(policy->cpu)) if (!cpu_online(policy->cpu))
...@@ -86,7 +83,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy, ...@@ -86,7 +83,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
policy->cpuinfo.max_freq); policy->cpuinfo.max_freq);
dprintk("verification lead to (%u - %u kHz) for cpu %u\n", pr_debug("verification lead to (%u - %u kHz) for cpu %u\n",
policy->min, policy->max, policy->cpu); policy->min, policy->max, policy->cpu);
return 0; return 0;
...@@ -110,7 +107,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, ...@@ -110,7 +107,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
}; };
unsigned int i; unsigned int i;
dprintk("request for target %u kHz (relation: %u) for cpu %u\n", pr_debug("request for target %u kHz (relation: %u) for cpu %u\n",
target_freq, relation, policy->cpu); target_freq, relation, policy->cpu);
switch (relation) { switch (relation) {
...@@ -167,7 +164,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, ...@@ -167,7 +164,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
} else } else
*index = optimal.index; *index = optimal.index;
dprintk("target is %u (%u kHz, %u)\n", *index, table[*index].frequency, pr_debug("target is %u (%u kHz, %u)\n", *index, table[*index].frequency,
table[*index].index); table[*index].index);
return 0; return 0;
...@@ -216,14 +213,14 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); ...@@ -216,14 +213,14 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs);
void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
unsigned int cpu) unsigned int cpu)
{ {
dprintk("setting show_table for cpu %u to %p\n", cpu, table); pr_debug("setting show_table for cpu %u to %p\n", cpu, table);
per_cpu(cpufreq_show_table, cpu) = table; per_cpu(cpufreq_show_table, cpu) = table;
} }
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr); EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr);
void cpufreq_frequency_table_put_attr(unsigned int cpu) void cpufreq_frequency_table_put_attr(unsigned int cpu)
{ {
dprintk("clearing show_table for cpu %u\n", cpu); pr_debug("clearing show_table for cpu %u\n", cpu);
per_cpu(cpufreq_show_table, cpu) = NULL; per_cpu(cpufreq_show_table, cpu) = NULL;
} }
EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr); EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr);
......
...@@ -397,23 +397,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, ...@@ -397,23 +397,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
void cpufreq_frequency_table_put_attr(unsigned int cpu); void cpufreq_frequency_table_put_attr(unsigned int cpu);
/*********************************************************************
* UNIFIED DEBUG HELPERS *
*********************************************************************/
#define CPUFREQ_DEBUG_CORE 1
#define CPUFREQ_DEBUG_DRIVER 2
#define CPUFREQ_DEBUG_GOVERNOR 4
#ifdef CONFIG_CPU_FREQ_DEBUG
extern void cpufreq_debug_printk(unsigned int type, const char *prefix,
const char *fmt, ...);
#else
#define cpufreq_debug_printk(msg...) do { } while(0)
#endif /* CONFIG_CPU_FREQ_DEBUG */
#endif /* _LINUX_CPUFREQ_H */ #endif /* _LINUX_CPUFREQ_H */
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