aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2011-03-27 09:04:46 -0400
committerDave Jones <davej@redhat.com>2011-05-04 11:50:57 -0400
commit2d06d8c49afdcc9bb35a85039fa50f0fe35bd40e (patch)
treed933a68fc71f6e2c3b95b744a87fa1d817bea3d6
parent27ecddc2a9f99ce4ac9a59a0acd77f7100b6d034 (diff)
[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: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r--arch/arm/mach-davinci/cpufreq.c4
-rw-r--r--arch/blackfin/mach-common/dpmc.c3
-rw-r--r--arch/ia64/kernel/cpufreq/acpi-cpufreq.c44
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c45
-rw-r--r--arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c6
-rw-r--r--arch/x86/kernel/cpu/cpufreq/gx-suspmod.c21
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.c11
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longrun.c17
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c10
-rw-r--r--arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c47
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.c33
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c100
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.h2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/sc520_freq.c6
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c23
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-ich.c28
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-lib.c43
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-smi.c41
-rw-r--r--drivers/acpi/processor_perflib.c6
-rw-r--r--drivers/cpufreq/Kconfig13
-rw-r--r--drivers/cpufreq/cpufreq.c180
-rw-r--r--drivers/cpufreq/cpufreq_performance.c5
-rw-r--r--drivers/cpufreq/cpufreq_powersave.c5
-rw-r--r--drivers/cpufreq/cpufreq_userspace.c13
-rw-r--r--drivers/cpufreq/freq_table.c19
-rw-r--r--include/linux/cpufreq.h19
26 files changed, 270 insertions, 474 deletions
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
index 0a95be1512bb..41669ecc1f91 100644
--- a/arch/arm/mach-davinci/cpufreq.c
+++ b/arch/arm/mach-davinci/cpufreq.c
@@ -94,9 +94,7 @@ static int davinci_target(struct cpufreq_policy *policy,
94 if (freqs.old == freqs.new) 94 if (freqs.old == freqs.new)
95 return ret; 95 return ret;
96 96
97 cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, 97 dev_dbg(&cpufreq.dev, "transition: %u --> %u\n", freqs.old, freqs.new);
98 dev_driver_string(cpufreq.dev),
99 "transition: %u --> %u\n", freqs.old, freqs.new);
100 98
101 ret = cpufreq_frequency_table_target(policy, pdata->freq_table, 99 ret = cpufreq_frequency_table_target(policy, pdata->freq_table,
102 freqs.new, relation, &idx); 100 freqs.new, relation, &idx);
diff --git a/arch/blackfin/mach-common/dpmc.c b/arch/blackfin/mach-common/dpmc.c
index 382099fd5561..5e4112e518a9 100644
--- a/arch/blackfin/mach-common/dpmc.c
+++ b/arch/blackfin/mach-common/dpmc.c
@@ -19,9 +19,6 @@
19 19
20#define DRIVER_NAME "bfin dpmc" 20#define DRIVER_NAME "bfin dpmc"
21 21
22#define dprintk(msg...) \
23 cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, DRIVER_NAME, msg)
24
25struct bfin_dpmc_platform_data *pdata; 22struct bfin_dpmc_platform_data *pdata;
26 23
27/** 24/**
diff --git a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
index 22f61526a8e1..f09b174244d5 100644
--- a/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
+++ b/arch/ia64/kernel/cpufreq/acpi-cpufreq.c
@@ -23,8 +23,6 @@
23#include <linux/acpi.h> 23#include <linux/acpi.h>
24#include <acpi/processor.h> 24#include <acpi/processor.h>
25 25
26#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "acpi-cpufreq", msg)
27
28MODULE_AUTHOR("Venkatesh Pallipadi"); 26MODULE_AUTHOR("Venkatesh Pallipadi");
29MODULE_DESCRIPTION("ACPI Processor P-States Driver"); 27MODULE_DESCRIPTION("ACPI Processor P-States Driver");
30MODULE_LICENSE("GPL"); 28MODULE_LICENSE("GPL");
@@ -47,12 +45,12 @@ processor_set_pstate (
47{ 45{
48 s64 retval; 46 s64 retval;
49 47
50 dprintk("processor_set_pstate\n"); 48 pr_debug("processor_set_pstate\n");
51 49
52 retval = ia64_pal_set_pstate((u64)value); 50 retval = ia64_pal_set_pstate((u64)value);
53 51
54 if (retval) { 52 if (retval) {
55 dprintk("Failed to set freq to 0x%x, with error 0x%lx\n", 53 pr_debug("Failed to set freq to 0x%x, with error 0x%lx\n",
56 value, retval); 54 value, retval);
57 return -ENODEV; 55 return -ENODEV;
58 } 56 }
@@ -67,14 +65,14 @@ processor_get_pstate (
67 u64 pstate_index = 0; 65 u64 pstate_index = 0;
68 s64 retval; 66 s64 retval;
69 67
70 dprintk("processor_get_pstate\n"); 68 pr_debug("processor_get_pstate\n");
71 69
72 retval = ia64_pal_get_pstate(&pstate_index, 70 retval = ia64_pal_get_pstate(&pstate_index,
73 PAL_GET_PSTATE_TYPE_INSTANT); 71 PAL_GET_PSTATE_TYPE_INSTANT);
74 *value = (u32) pstate_index; 72 *value = (u32) pstate_index;
75 73
76 if (retval) 74 if (retval)
77 dprintk("Failed to get current freq with " 75 pr_debug("Failed to get current freq with "
78 "error 0x%lx, idx 0x%x\n", retval, *value); 76 "error 0x%lx, idx 0x%x\n", retval, *value);
79 77
80 return (int)retval; 78 return (int)retval;
@@ -90,7 +88,7 @@ extract_clock (
90{ 88{
91 unsigned long i; 89 unsigned long i;
92 90
93 dprintk("extract_clock\n"); 91 pr_debug("extract_clock\n");
94 92
95 for (i = 0; i < data->acpi_data.state_count; i++) { 93 for (i = 0; i < data->acpi_data.state_count; i++) {
96 if (value == data->acpi_data.states[i].status) 94 if (value == data->acpi_data.states[i].status)
@@ -110,7 +108,7 @@ processor_get_freq (
110 cpumask_t saved_mask; 108 cpumask_t saved_mask;
111 unsigned long clock_freq; 109 unsigned long clock_freq;
112 110
113 dprintk("processor_get_freq\n"); 111 pr_debug("processor_get_freq\n");
114 112
115 saved_mask = current->cpus_allowed; 113 saved_mask = current->cpus_allowed;
116 set_cpus_allowed_ptr(current, cpumask_of(cpu)); 114 set_cpus_allowed_ptr(current, cpumask_of(cpu));
@@ -148,7 +146,7 @@ processor_set_freq (
148 cpumask_t saved_mask; 146 cpumask_t saved_mask;
149 int retval; 147 int retval;
150 148
151 dprintk("processor_set_freq\n"); 149 pr_debug("processor_set_freq\n");
152 150
153 saved_mask = current->cpus_allowed; 151 saved_mask = current->cpus_allowed;
154 set_cpus_allowed_ptr(current, cpumask_of(cpu)); 152 set_cpus_allowed_ptr(current, cpumask_of(cpu));
@@ -159,16 +157,16 @@ processor_set_freq (
159 157
160 if (state == data->acpi_data.state) { 158 if (state == data->acpi_data.state) {
161 if (unlikely(data->resume)) { 159 if (unlikely(data->resume)) {
162 dprintk("Called after resume, resetting to P%d\n", state); 160 pr_debug("Called after resume, resetting to P%d\n", state);
163 data->resume = 0; 161 data->resume = 0;
164 } else { 162 } else {
165 dprintk("Already at target state (P%d)\n", state); 163 pr_debug("Already at target state (P%d)\n", state);
166 retval = 0; 164 retval = 0;
167 goto migrate_end; 165 goto migrate_end;
168 } 166 }
169 } 167 }
170 168
171 dprintk("Transitioning from P%d to P%d\n", 169 pr_debug("Transitioning from P%d to P%d\n",
172 data->acpi_data.state, state); 170 data->acpi_data.state, state);
173 171
174 /* cpufreq frequency struct */ 172 /* cpufreq frequency struct */
@@ -186,7 +184,7 @@ processor_set_freq (
186 184
187 value = (u32) data->acpi_data.states[state].control; 185 value = (u32) data->acpi_data.states[state].control;
188 186
189 dprintk("Transitioning to state: 0x%08x\n", value); 187 pr_debug("Transitioning to state: 0x%08x\n", value);
190 188
191 ret = processor_set_pstate(value); 189 ret = processor_set_pstate(value);
192 if (ret) { 190 if (ret) {
@@ -219,7 +217,7 @@ acpi_cpufreq_get (
219{ 217{
220 struct cpufreq_acpi_io *data = acpi_io_data[cpu]; 218 struct cpufreq_acpi_io *data = acpi_io_data[cpu];
221 219
222 dprintk("acpi_cpufreq_get\n"); 220 pr_debug("acpi_cpufreq_get\n");
223 221
224 return processor_get_freq(data, cpu); 222 return processor_get_freq(data, cpu);
225} 223}
@@ -235,7 +233,7 @@ acpi_cpufreq_target (
235 unsigned int next_state = 0; 233 unsigned int next_state = 0;
236 unsigned int result = 0; 234 unsigned int result = 0;
237 235
238 dprintk("acpi_cpufreq_setpolicy\n"); 236 pr_debug("acpi_cpufreq_setpolicy\n");
239 237
240 result = cpufreq_frequency_table_target(policy, 238 result = cpufreq_frequency_table_target(policy,
241 data->freq_table, target_freq, relation, &next_state); 239 data->freq_table, target_freq, relation, &next_state);
@@ -255,7 +253,7 @@ acpi_cpufreq_verify (
255 unsigned int result = 0; 253 unsigned int result = 0;
256 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; 254 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
257 255
258 dprintk("acpi_cpufreq_verify\n"); 256 pr_debug("acpi_cpufreq_verify\n");
259 257
260 result = cpufreq_frequency_table_verify(policy, 258 result = cpufreq_frequency_table_verify(policy,
261 data->freq_table); 259 data->freq_table);
@@ -273,7 +271,7 @@ acpi_cpufreq_cpu_init (
273 struct cpufreq_acpi_io *data; 271 struct cpufreq_acpi_io *data;
274 unsigned int result = 0; 272 unsigned int result = 0;
275 273
276 dprintk("acpi_cpufreq_cpu_init\n"); 274 pr_debug("acpi_cpufreq_cpu_init\n");
277 275
278 data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); 276 data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
279 if (!data) 277 if (!data)
@@ -288,7 +286,7 @@ acpi_cpufreq_cpu_init (
288 286
289 /* capability check */ 287 /* capability check */
290 if (data->acpi_data.state_count <= 1) { 288 if (data->acpi_data.state_count <= 1) {
291 dprintk("No P-States\n"); 289 pr_debug("No P-States\n");
292 result = -ENODEV; 290 result = -ENODEV;
293 goto err_unreg; 291 goto err_unreg;
294 } 292 }
@@ -297,7 +295,7 @@ acpi_cpufreq_cpu_init (
297 ACPI_ADR_SPACE_FIXED_HARDWARE) || 295 ACPI_ADR_SPACE_FIXED_HARDWARE) ||
298 (data->acpi_data.status_register.space_id != 296 (data->acpi_data.status_register.space_id !=
299 ACPI_ADR_SPACE_FIXED_HARDWARE)) { 297 ACPI_ADR_SPACE_FIXED_HARDWARE)) {
300 dprintk("Unsupported address space [%d, %d]\n", 298 pr_debug("Unsupported address space [%d, %d]\n",
301 (u32) (data->acpi_data.control_register.space_id), 299 (u32) (data->acpi_data.control_register.space_id),
302 (u32) (data->acpi_data.status_register.space_id)); 300 (u32) (data->acpi_data.status_register.space_id));
303 result = -ENODEV; 301 result = -ENODEV;
@@ -348,7 +346,7 @@ acpi_cpufreq_cpu_init (
348 "activated.\n", cpu); 346 "activated.\n", cpu);
349 347
350 for (i = 0; i < data->acpi_data.state_count; i++) 348 for (i = 0; i < data->acpi_data.state_count; i++)
351 dprintk(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n", 349 pr_debug(" %cP%d: %d MHz, %d mW, %d uS, %d uS, 0x%x 0x%x\n",
352 (i == data->acpi_data.state?'*':' '), i, 350 (i == data->acpi_data.state?'*':' '), i,
353 (u32) data->acpi_data.states[i].core_frequency, 351 (u32) data->acpi_data.states[i].core_frequency,
354 (u32) data->acpi_data.states[i].power, 352 (u32) data->acpi_data.states[i].power,
@@ -383,7 +381,7 @@ acpi_cpufreq_cpu_exit (
383{ 381{
384 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu]; 382 struct cpufreq_acpi_io *data = acpi_io_data[policy->cpu];
385 383
386 dprintk("acpi_cpufreq_cpu_exit\n"); 384 pr_debug("acpi_cpufreq_cpu_exit\n");
387 385
388 if (data) { 386 if (data) {
389 cpufreq_frequency_table_put_attr(policy->cpu); 387 cpufreq_frequency_table_put_attr(policy->cpu);
@@ -418,7 +416,7 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
418static int __init 416static int __init
419acpi_cpufreq_init (void) 417acpi_cpufreq_init (void)
420{ 418{
421 dprintk("acpi_cpufreq_init\n"); 419 pr_debug("acpi_cpufreq_init\n");
422 420
423 return cpufreq_register_driver(&acpi_cpufreq_driver); 421 return cpufreq_register_driver(&acpi_cpufreq_driver);
424} 422}
@@ -427,7 +425,7 @@ acpi_cpufreq_init (void)
427static void __exit 425static void __exit
428acpi_cpufreq_exit (void) 426acpi_cpufreq_exit (void)
429{ 427{
430 dprintk("acpi_cpufreq_exit\n"); 428 pr_debug("acpi_cpufreq_exit\n");
431 429
432 cpufreq_unregister_driver(&acpi_cpufreq_driver); 430 cpufreq_unregister_driver(&acpi_cpufreq_driver);
433 return; 431 return;
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index a2baafb2fe6d..4e04e1274388 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -47,9 +47,6 @@
47#include <asm/cpufeature.h> 47#include <asm/cpufeature.h>
48#include "mperf.h" 48#include "mperf.h"
49 49
50#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
51 "acpi-cpufreq", msg)
52
53MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski"); 50MODULE_AUTHOR("Paul Diefenbaugh, Dominik Brodowski");
54MODULE_DESCRIPTION("ACPI Processor P-States Driver"); 51MODULE_DESCRIPTION("ACPI Processor P-States Driver");
55MODULE_LICENSE("GPL"); 52MODULE_LICENSE("GPL");
@@ -233,7 +230,7 @@ static u32 get_cur_val(const struct cpumask *mask)
233 cmd.mask = mask; 230 cmd.mask = mask;
234 drv_read(&cmd); 231 drv_read(&cmd);
235 232
236 dprintk("get_cur_val = %u\n", cmd.val); 233 pr_debug("get_cur_val = %u\n", cmd.val);
237 234
238 return cmd.val; 235 return cmd.val;
239} 236}
@@ -244,7 +241,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
244 unsigned int freq; 241 unsigned int freq;
245 unsigned int cached_freq; 242 unsigned int cached_freq;
246 243
247 dprintk("get_cur_freq_on_cpu (%d)\n", cpu); 244 pr_debug("get_cur_freq_on_cpu (%d)\n", cpu);
248 245
249 if (unlikely(data == NULL || 246 if (unlikely(data == NULL ||
250 data->acpi_data == NULL || data->freq_table == NULL)) { 247 data->acpi_data == NULL || data->freq_table == NULL)) {
@@ -261,7 +258,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
261 data->resume = 1; 258 data->resume = 1;
262 } 259 }
263 260
264 dprintk("cur freq = %u\n", freq); 261 pr_debug("cur freq = %u\n", freq);
265 262
266 return freq; 263 return freq;
267} 264}
@@ -293,7 +290,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
293 unsigned int i; 290 unsigned int i;
294 int result = 0; 291 int result = 0;
295 292
296 dprintk("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu); 293 pr_debug("acpi_cpufreq_target %d (%d)\n", target_freq, policy->cpu);
297 294
298 if (unlikely(data == NULL || 295 if (unlikely(data == NULL ||
299 data->acpi_data == NULL || data->freq_table == NULL)) { 296 data->acpi_data == NULL || data->freq_table == NULL)) {
@@ -313,11 +310,11 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
313 next_perf_state = data->freq_table[next_state].index; 310 next_perf_state = data->freq_table[next_state].index;
314 if (perf->state == next_perf_state) { 311 if (perf->state == next_perf_state) {
315 if (unlikely(data->resume)) { 312 if (unlikely(data->resume)) {
316 dprintk("Called after resume, resetting to P%d\n", 313 pr_debug("Called after resume, resetting to P%d\n",
317 next_perf_state); 314 next_perf_state);
318 data->resume = 0; 315 data->resume = 0;
319 } else { 316 } else {
320 dprintk("Already at target state (P%d)\n", 317 pr_debug("Already at target state (P%d)\n",
321 next_perf_state); 318 next_perf_state);
322 goto out; 319 goto out;
323 } 320 }
@@ -357,7 +354,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
357 354
358 if (acpi_pstate_strict) { 355 if (acpi_pstate_strict) {
359 if (!check_freqs(cmd.mask, freqs.new, data)) { 356 if (!check_freqs(cmd.mask, freqs.new, data)) {
360 dprintk("acpi_cpufreq_target failed (%d)\n", 357 pr_debug("acpi_cpufreq_target failed (%d)\n",
361 policy->cpu); 358 policy->cpu);
362 result = -EAGAIN; 359 result = -EAGAIN;
363 goto out; 360 goto out;
@@ -378,7 +375,7 @@ static int acpi_cpufreq_verify(struct cpufreq_policy *policy)
378{ 375{
379 struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu); 376 struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
380 377
381 dprintk("acpi_cpufreq_verify\n"); 378 pr_debug("acpi_cpufreq_verify\n");
382 379
383 return cpufreq_frequency_table_verify(policy, data->freq_table); 380 return cpufreq_frequency_table_verify(policy, data->freq_table);
384} 381}
@@ -433,11 +430,11 @@ static void free_acpi_perf_data(void)
433static int __init acpi_cpufreq_early_init(void) 430static int __init acpi_cpufreq_early_init(void)
434{ 431{
435 unsigned int i; 432 unsigned int i;
436 dprintk("acpi_cpufreq_early_init\n"); 433 pr_debug("acpi_cpufreq_early_init\n");
437 434
438 acpi_perf_data = alloc_percpu(struct acpi_processor_performance); 435 acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
439 if (!acpi_perf_data) { 436 if (!acpi_perf_data) {
440 dprintk("Memory allocation error for acpi_perf_data.\n"); 437 pr_debug("Memory allocation error for acpi_perf_data.\n");
441 return -ENOMEM; 438 return -ENOMEM;
442 } 439 }
443 for_each_possible_cpu(i) { 440 for_each_possible_cpu(i) {
@@ -519,7 +516,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
519 static int blacklisted; 516 static int blacklisted;
520#endif 517#endif
521 518
522 dprintk("acpi_cpufreq_cpu_init\n"); 519 pr_debug("acpi_cpufreq_cpu_init\n");
523 520
524#ifdef CONFIG_SMP 521#ifdef CONFIG_SMP
525 if (blacklisted) 522 if (blacklisted)
@@ -566,7 +563,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
566 563
567 /* capability check */ 564 /* capability check */
568 if (perf->state_count <= 1) { 565 if (perf->state_count <= 1) {
569 dprintk("No P-States\n"); 566 pr_debug("No P-States\n");
570 result = -ENODEV; 567 result = -ENODEV;
571 goto err_unreg; 568 goto err_unreg;
572 } 569 }
@@ -578,11 +575,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
578 575
579 switch (perf->control_register.space_id) { 576 switch (perf->control_register.space_id) {
580 case ACPI_ADR_SPACE_SYSTEM_IO: 577 case ACPI_ADR_SPACE_SYSTEM_IO:
581 dprintk("SYSTEM IO addr space\n"); 578 pr_debug("SYSTEM IO addr space\n");
582 data->cpu_feature = SYSTEM_IO_CAPABLE; 579 data->cpu_feature = SYSTEM_IO_CAPABLE;
583 break; 580 break;
584 case ACPI_ADR_SPACE_FIXED_HARDWARE: 581 case ACPI_ADR_SPACE_FIXED_HARDWARE:
585 dprintk("HARDWARE addr space\n"); 582 pr_debug("HARDWARE addr space\n");
586 if (!check_est_cpu(cpu)) { 583 if (!check_est_cpu(cpu)) {
587 result = -ENODEV; 584 result = -ENODEV;
588 goto err_unreg; 585 goto err_unreg;
@@ -590,7 +587,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
590 data->cpu_feature = SYSTEM_INTEL_MSR_CAPABLE; 587 data->cpu_feature = SYSTEM_INTEL_MSR_CAPABLE;
591 break; 588 break;
592 default: 589 default:
593 dprintk("Unknown addr space %d\n", 590 pr_debug("Unknown addr space %d\n",
594 (u32) (perf->control_register.space_id)); 591 (u32) (perf->control_register.space_id));
595 result = -ENODEV; 592 result = -ENODEV;
596 goto err_unreg; 593 goto err_unreg;
@@ -661,9 +658,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
661 if (cpu_has(c, X86_FEATURE_APERFMPERF)) 658 if (cpu_has(c, X86_FEATURE_APERFMPERF))
662 acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf; 659 acpi_cpufreq_driver.getavg = cpufreq_get_measured_perf;
663 660
664 dprintk("CPU%u - ACPI performance management activated.\n", cpu); 661 pr_debug("CPU%u - ACPI performance management activated.\n", cpu);
665 for (i = 0; i < perf->state_count; i++) 662 for (i = 0; i < perf->state_count; i++)
666 dprintk(" %cP%d: %d MHz, %d mW, %d uS\n", 663 pr_debug(" %cP%d: %d MHz, %d mW, %d uS\n",
667 (i == perf->state ? '*' : ' '), i, 664 (i == perf->state ? '*' : ' '), i,
668 (u32) perf->states[i].core_frequency, 665 (u32) perf->states[i].core_frequency,
669 (u32) perf->states[i].power, 666 (u32) perf->states[i].power,
@@ -694,7 +691,7 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
694{ 691{
695 struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu); 692 struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
696 693
697 dprintk("acpi_cpufreq_cpu_exit\n"); 694 pr_debug("acpi_cpufreq_cpu_exit\n");
698 695
699 if (data) { 696 if (data) {
700 cpufreq_frequency_table_put_attr(policy->cpu); 697 cpufreq_frequency_table_put_attr(policy->cpu);
@@ -712,7 +709,7 @@ static int acpi_cpufreq_resume(struct cpufreq_policy *policy)
712{ 709{
713 struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu); 710 struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
714 711
715 dprintk("acpi_cpufreq_resume\n"); 712 pr_debug("acpi_cpufreq_resume\n");
716 713
717 data->resume = 1; 714 data->resume = 1;
718 715
@@ -743,7 +740,7 @@ static int __init acpi_cpufreq_init(void)
743 if (acpi_disabled) 740 if (acpi_disabled)
744 return 0; 741 return 0;
745 742
746 dprintk("acpi_cpufreq_init\n"); 743 pr_debug("acpi_cpufreq_init\n");
747 744
748 ret = acpi_cpufreq_early_init(); 745 ret = acpi_cpufreq_early_init();
749 if (ret) 746 if (ret)
@@ -758,7 +755,7 @@ static int __init acpi_cpufreq_init(void)
758 755
759static void __exit acpi_cpufreq_exit(void) 756static void __exit acpi_cpufreq_exit(void)
760{ 757{
761 dprintk("acpi_cpufreq_exit\n"); 758 pr_debug("acpi_cpufreq_exit\n");
762 759
763 cpufreq_unregister_driver(&acpi_cpufreq_driver); 760 cpufreq_unregister_driver(&acpi_cpufreq_driver);
764 761
diff --git a/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
index 141abebc4516..7bac808804f3 100644
--- a/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
+++ b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
@@ -57,8 +57,6 @@ MODULE_PARM_DESC(min_fsb,
57 "Minimum FSB to use, if not defined: current FSB - 50"); 57 "Minimum FSB to use, if not defined: current FSB - 50");
58 58
59#define PFX "cpufreq-nforce2: " 59#define PFX "cpufreq-nforce2: "
60#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
61 "cpufreq-nforce2", msg)
62 60
63/** 61/**
64 * nforce2_calc_fsb - calculate FSB 62 * nforce2_calc_fsb - calculate FSB
@@ -270,7 +268,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
270 if (freqs.old == freqs.new) 268 if (freqs.old == freqs.new)
271 return 0; 269 return 0;
272 270
273 dprintk("Old CPU frequency %d kHz, new %d kHz\n", 271 pr_debug("Old CPU frequency %d kHz, new %d kHz\n",
274 freqs.old, freqs.new); 272 freqs.old, freqs.new);
275 273
276 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 274 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
@@ -282,7 +280,7 @@ static int nforce2_target(struct cpufreq_policy *policy,
282 printk(KERN_ERR PFX "Changing FSB to %d failed\n", 280 printk(KERN_ERR PFX "Changing FSB to %d failed\n",
283 target_fsb); 281 target_fsb);
284 else 282 else
285 dprintk("Changed FSB successfully to %d\n", 283 pr_debug("Changed FSB successfully to %d\n",
286 target_fsb); 284 target_fsb);
287 285
288 /* Enable IRQs */ 286 /* Enable IRQs */
diff --git a/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
index 32974cf84232..ffe1f2c92ed3 100644
--- a/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
@@ -142,9 +142,6 @@ module_param(max_duration, int, 0444);
142#define POLICY_MIN_DIV 20 142#define POLICY_MIN_DIV 20
143 143
144 144
145#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
146 "gx-suspmod", msg)
147
148/** 145/**
149 * we can detect a core multipiler from dir0_lsb 146 * we can detect a core multipiler from dir0_lsb
150 * from GX1 datasheet p.56, 147 * from GX1 datasheet p.56,
@@ -191,7 +188,7 @@ static __init struct pci_dev *gx_detect_chipset(void)
191 /* check if CPU is a MediaGX or a Geode. */ 188 /* check if CPU is a MediaGX or a Geode. */
192 if ((boot_cpu_data.x86_vendor != X86_VENDOR_NSC) && 189 if ((boot_cpu_data.x86_vendor != X86_VENDOR_NSC) &&
193 (boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) { 190 (boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX)) {
194 dprintk("error: no MediaGX/Geode processor found!\n"); 191 pr_debug("error: no MediaGX/Geode processor found!\n");
195 return NULL; 192 return NULL;
196 } 193 }
197 194
@@ -201,7 +198,7 @@ static __init struct pci_dev *gx_detect_chipset(void)
201 return gx_pci; 198 return gx_pci;
202 } 199 }
203 200
204 dprintk("error: no supported chipset found!\n"); 201 pr_debug("error: no supported chipset found!\n");
205 return NULL; 202 return NULL;
206} 203}
207 204
@@ -305,14 +302,14 @@ static void gx_set_cpuspeed(unsigned int khz)
305 break; 302 break;
306 default: 303 default:
307 local_irq_restore(flags); 304 local_irq_restore(flags);
308 dprintk("fatal: try to set unknown chipset.\n"); 305 pr_debug("fatal: try to set unknown chipset.\n");
309 return; 306 return;
310 } 307 }
311 } else { 308 } else {
312 suscfg = gx_params->pci_suscfg & ~(SUSMOD); 309 suscfg = gx_params->pci_suscfg & ~(SUSMOD);
313 gx_params->off_duration = 0; 310 gx_params->off_duration = 0;
314 gx_params->on_duration = 0; 311 gx_params->on_duration = 0;
315 dprintk("suspend modulation disabled: cpu runs 100%% speed.\n"); 312 pr_debug("suspend modulation disabled: cpu runs 100%% speed.\n");
316 } 313 }
317 314
318 gx_write_byte(PCI_MODOFF, gx_params->off_duration); 315 gx_write_byte(PCI_MODOFF, gx_params->off_duration);
@@ -327,9 +324,9 @@ static void gx_set_cpuspeed(unsigned int khz)
327 324
328 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 325 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
329 326
330 dprintk("suspend modulation w/ duration of ON:%d us, OFF:%d us\n", 327 pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n",
331 gx_params->on_duration * 32, gx_params->off_duration * 32); 328 gx_params->on_duration * 32, gx_params->off_duration * 32);
332 dprintk("suspend modulation w/ clock speed: %d kHz.\n", freqs.new); 329 pr_debug("suspend modulation w/ clock speed: %d kHz.\n", freqs.new);
333} 330}
334 331
335/**************************************************************** 332/****************************************************************
@@ -428,8 +425,8 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy)
428 stock_freq = maxfreq; 425 stock_freq = maxfreq;
429 curfreq = gx_get_cpuspeed(0); 426 curfreq = gx_get_cpuspeed(0);
430 427
431 dprintk("cpu max frequency is %d.\n", maxfreq); 428 pr_debug("cpu max frequency is %d.\n", maxfreq);
432 dprintk("cpu current frequency is %dkHz.\n", curfreq); 429 pr_debug("cpu current frequency is %dkHz.\n", curfreq);
433 430
434 /* setup basic struct for cpufreq API */ 431 /* setup basic struct for cpufreq API */
435 policy->cpu = 0; 432 policy->cpu = 0;
@@ -475,7 +472,7 @@ static int __init cpufreq_gx_init(void)
475 if (max_duration > 0xff) 472 if (max_duration > 0xff)
476 max_duration = 0xff; 473 max_duration = 0xff;
477 474
478 dprintk("geode suspend modulation available.\n"); 475 pr_debug("geode suspend modulation available.\n");
479 476
480 params = kzalloc(sizeof(struct gxfreq_params), GFP_KERNEL); 477 params = kzalloc(sizeof(struct gxfreq_params), GFP_KERNEL);
481 if (params == NULL) 478 if (params == NULL)
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c
index cf48cdd6907d..f47d26e2a135 100644
--- a/arch/x86/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c
@@ -77,9 +77,6 @@ static int scale_voltage;
77static int disable_acpi_c3; 77static int disable_acpi_c3;
78static int revid_errata; 78static int revid_errata;
79 79
80#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
81 "longhaul", msg)
82
83 80
84/* Clock ratios multiplied by 10 */ 81/* Clock ratios multiplied by 10 */
85static int mults[32]; 82static int mults[32];
@@ -87,7 +84,6 @@ static int eblcr[32];
87static int longhaul_version; 84static int longhaul_version;
88static struct cpufreq_frequency_table *longhaul_table; 85static struct cpufreq_frequency_table *longhaul_table;
89 86
90#ifdef CONFIG_CPU_FREQ_DEBUG
91static char speedbuffer[8]; 87static char speedbuffer[8];
92 88
93static char *print_speed(int speed) 89static char *print_speed(int speed)
@@ -106,7 +102,6 @@ static char *print_speed(int speed)
106 102
107 return speedbuffer; 103 return speedbuffer;
108} 104}
109#endif
110 105
111 106
112static unsigned int calc_speed(int mult) 107static unsigned int calc_speed(int mult)
@@ -275,7 +270,7 @@ static void longhaul_setstate(unsigned int table_index)
275 270
276 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 271 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
277 272
278 dprintk("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", 273 pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
279 fsb, mult/10, mult%10, print_speed(speed/1000)); 274 fsb, mult/10, mult%10, print_speed(speed/1000));
280retry_loop: 275retry_loop:
281 preempt_disable(); 276 preempt_disable();
@@ -460,12 +455,12 @@ static int __cpuinit longhaul_get_ranges(void)
460 break; 455 break;
461 } 456 }
462 457
463 dprintk("MinMult:%d.%dx MaxMult:%d.%dx\n", 458 pr_debug("MinMult:%d.%dx MaxMult:%d.%dx\n",
464 minmult/10, minmult%10, maxmult/10, maxmult%10); 459 minmult/10, minmult%10, maxmult/10, maxmult%10);
465 460
466 highest_speed = calc_speed(maxmult); 461 highest_speed = calc_speed(maxmult);
467 lowest_speed = calc_speed(minmult); 462 lowest_speed = calc_speed(minmult);
468 dprintk("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, 463 pr_debug("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb,
469 print_speed(lowest_speed/1000), 464 print_speed(lowest_speed/1000),
470 print_speed(highest_speed/1000)); 465 print_speed(highest_speed/1000));
471 466
diff --git a/arch/x86/kernel/cpu/cpufreq/longrun.c b/arch/x86/kernel/cpu/cpufreq/longrun.c
index d9f51367666b..34ea359b370e 100644
--- a/arch/x86/kernel/cpu/cpufreq/longrun.c
+++ b/arch/x86/kernel/cpu/cpufreq/longrun.c
@@ -15,9 +15,6 @@
15#include <asm/msr.h> 15#include <asm/msr.h>
16#include <asm/processor.h> 16#include <asm/processor.h>
17 17
18#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
19 "longrun", msg)
20
21static struct cpufreq_driver longrun_driver; 18static struct cpufreq_driver longrun_driver;
22 19
23/** 20/**
@@ -40,14 +37,14 @@ static void __cpuinit longrun_get_policy(struct cpufreq_policy *policy)
40 u32 msr_lo, msr_hi; 37 u32 msr_lo, msr_hi;
41 38
42 rdmsr(MSR_TMTA_LONGRUN_FLAGS, msr_lo, msr_hi); 39 rdmsr(MSR_TMTA_LONGRUN_FLAGS, msr_lo, msr_hi);
43 dprintk("longrun flags are %x - %x\n", msr_lo, msr_hi); 40 pr_debug("longrun flags are %x - %x\n", msr_lo, msr_hi);
44 if (msr_lo & 0x01) 41 if (msr_lo & 0x01)
45 policy->policy = CPUFREQ_POLICY_PERFORMANCE; 42 policy->policy = CPUFREQ_POLICY_PERFORMANCE;
46 else 43 else
47 policy->policy = CPUFREQ_POLICY_POWERSAVE; 44 policy->policy = CPUFREQ_POLICY_POWERSAVE;
48 45
49 rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); 46 rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi);
50 dprintk("longrun ctrl is %x - %x\n", msr_lo, msr_hi); 47 pr_debug("longrun ctrl is %x - %x\n", msr_lo, msr_hi);
51 msr_lo &= 0x0000007F; 48 msr_lo &= 0x0000007F;
52 msr_hi &= 0x0000007F; 49 msr_hi &= 0x0000007F;
53 50
@@ -150,7 +147,7 @@ static unsigned int longrun_get(unsigned int cpu)
150 return 0; 147 return 0;
151 148
152 cpuid(0x80860007, &eax, &ebx, &ecx, &edx); 149 cpuid(0x80860007, &eax, &ebx, &ecx, &edx);
153 dprintk("cpuid eax is %u\n", eax); 150 pr_debug("cpuid eax is %u\n", eax);
154 151
155 return eax * 1000; 152 return eax * 1000;
156} 153}
@@ -196,7 +193,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
196 rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi); 193 rdmsr(MSR_TMTA_LRTI_VOLT_MHZ, msr_lo, msr_hi);
197 *high_freq = msr_lo * 1000; /* to kHz */ 194 *high_freq = msr_lo * 1000; /* to kHz */
198 195
199 dprintk("longrun table interface told %u - %u kHz\n", 196 pr_debug("longrun table interface told %u - %u kHz\n",
200 *low_freq, *high_freq); 197 *low_freq, *high_freq);
201 198
202 if (*low_freq > *high_freq) 199 if (*low_freq > *high_freq)
@@ -207,7 +204,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
207 /* set the upper border to the value determined during TSC init */ 204 /* set the upper border to the value determined during TSC init */
208 *high_freq = (cpu_khz / 1000); 205 *high_freq = (cpu_khz / 1000);
209 *high_freq = *high_freq * 1000; 206 *high_freq = *high_freq * 1000;
210 dprintk("high frequency is %u kHz\n", *high_freq); 207 pr_debug("high frequency is %u kHz\n", *high_freq);
211 208
212 /* get current borders */ 209 /* get current borders */
213 rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi); 210 rdmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi);
@@ -233,7 +230,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
233 /* restore values */ 230 /* restore values */
234 wrmsr(MSR_TMTA_LONGRUN_CTRL, save_lo, save_hi); 231 wrmsr(MSR_TMTA_LONGRUN_CTRL, save_lo, save_hi);
235 } 232 }
236 dprintk("percentage is %u %%, freq is %u MHz\n", ecx, eax); 233 pr_debug("percentage is %u %%, freq is %u MHz\n", ecx, eax);
237 234
238 /* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq) 235 /* performance_pctg = (current_freq - low_freq)/(high_freq - low_freq)
239 * eqals 236 * eqals
@@ -249,7 +246,7 @@ static int __cpuinit longrun_determine_freqs(unsigned int *low_freq,
249 edx = ((eax - ebx) * 100) / (100 - ecx); 246 edx = ((eax - ebx) * 100) / (100 - ecx);
250 *low_freq = edx * 1000; /* back to kHz */ 247 *low_freq = edx * 1000; /* back to kHz */
251 248
252 dprintk("low frequency is %u kHz\n", *low_freq); 249 pr_debug("low frequency is %u kHz\n", *low_freq);
253 250
254 if (*low_freq > *high_freq) 251 if (*low_freq > *high_freq)
255 *low_freq = *high_freq; 252 *low_freq = *high_freq;
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index 52c93648e492..6be3e0760c26 100644
--- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
@@ -35,8 +35,6 @@
35#include "speedstep-lib.h" 35#include "speedstep-lib.h"
36 36
37#define PFX "p4-clockmod: " 37#define PFX "p4-clockmod: "
38#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
39 "p4-clockmod", msg)
40 38
41/* 39/*
42 * Duty Cycle (3bits), note DC_DISABLE is not specified in 40 * 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 rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h); 64 rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h);
67 65
68 if (l & 0x01) 66 if (l & 0x01)
69 dprintk("CPU#%d currently thermal throttled\n", cpu); 67 pr_debug("CPU#%d currently thermal throttled\n", cpu);
70 68
71 if (has_N44_O17_errata[cpu] && 69 if (has_N44_O17_errata[cpu] &&
72 (newstate == DC_25PT || newstate == DC_DFLT)) 70 (newstate == DC_25PT || newstate == DC_DFLT))
@@ -74,10 +72,10 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
74 72
75 rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, &l, &h); 73 rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, &l, &h);
76 if (newstate == DC_DISABLE) { 74 if (newstate == DC_DISABLE) {
77 dprintk("CPU#%d disabling modulation\n", cpu); 75 pr_debug("CPU#%d disabling modulation\n", cpu);
78 wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, l & ~(1<<4), h); 76 wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, l & ~(1<<4), h);
79 } else { 77 } else {
80 dprintk("CPU#%d setting duty cycle to %d%%\n", 78 pr_debug("CPU#%d setting duty cycle to %d%%\n",
81 cpu, ((125 * newstate) / 10)); 79 cpu, ((125 * newstate) / 10));
82 /* bits 63 - 5 : reserved 80 /* bits 63 - 5 : reserved
83 * bit 4 : enable/disable 81 * bit 4 : enable/disable
@@ -217,7 +215,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
217 case 0x0f11: 215 case 0x0f11:
218 case 0x0f12: 216 case 0x0f12:
219 has_N44_O17_errata[policy->cpu] = 1; 217 has_N44_O17_errata[policy->cpu] = 1;
220 dprintk("has errata -- disabling low frequencies\n"); 218 pr_debug("has errata -- disabling low frequencies\n");
221 } 219 }
222 220
223 if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4D && 221 if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4D &&
diff --git a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
index 907c8e637ef5..7b0603eb0129 100644
--- a/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
@@ -48,9 +48,6 @@
48 48
49#define BUF_SZ 4 49#define BUF_SZ 4
50 50
51#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
52 "pcc-cpufreq", msg)
53
54struct pcc_register_resource { 51struct pcc_register_resource {
55 u8 descriptor; 52 u8 descriptor;
56 u16 length; 53 u16 length;
@@ -152,7 +149,7 @@ static unsigned int pcc_get_freq(unsigned int cpu)
152 149
153 spin_lock(&pcc_lock); 150 spin_lock(&pcc_lock);
154 151
155 dprintk("get: get_freq for CPU %d\n", cpu); 152 pr_debug("get: get_freq for CPU %d\n", cpu);
156 pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu); 153 pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu);
157 154
158 input_buffer = 0x1; 155 input_buffer = 0x1;
@@ -170,7 +167,7 @@ static unsigned int pcc_get_freq(unsigned int cpu)
170 167
171 status = ioread16(&pcch_hdr->status); 168 status = ioread16(&pcch_hdr->status);
172 if (status != CMD_COMPLETE) { 169 if (status != CMD_COMPLETE) {
173 dprintk("get: FAILED: for CPU %d, status is %d\n", 170 pr_debug("get: FAILED: for CPU %d, status is %d\n",
174 cpu, status); 171 cpu, status);
175 goto cmd_incomplete; 172 goto cmd_incomplete;
176 } 173 }
@@ -178,14 +175,14 @@ static unsigned int pcc_get_freq(unsigned int cpu)
178 curr_freq = (((ioread32(&pcch_hdr->nominal) * (output_buffer & 0xff)) 175 curr_freq = (((ioread32(&pcch_hdr->nominal) * (output_buffer & 0xff))
179 / 100) * 1000); 176 / 100) * 1000);
180 177
181 dprintk("get: SUCCESS: (virtual) output_offset for cpu %d is " 178 pr_debug("get: SUCCESS: (virtual) output_offset for cpu %d is "
182 "0x%x, contains a value of: 0x%x. Speed is: %d MHz\n", 179 "0x%p, contains a value of: 0x%x. Speed is: %d MHz\n",
183 cpu, (pcch_virt_addr + pcc_cpu_data->output_offset), 180 cpu, (pcch_virt_addr + pcc_cpu_data->output_offset),
184 output_buffer, curr_freq); 181 output_buffer, curr_freq);
185 182
186 freq_limit = (output_buffer >> 8) & 0xff; 183 freq_limit = (output_buffer >> 8) & 0xff;
187 if (freq_limit != 0xff) { 184 if (freq_limit != 0xff) {
188 dprintk("get: frequency for cpu %d is being temporarily" 185 pr_debug("get: frequency for cpu %d is being temporarily"
189 " capped at %d\n", cpu, curr_freq); 186 " capped at %d\n", cpu, curr_freq);
190 } 187 }
191 188
@@ -212,8 +209,8 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
212 cpu = policy->cpu; 209 cpu = policy->cpu;
213 pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu); 210 pcc_cpu_data = per_cpu_ptr(pcc_cpu_info, cpu);
214 211
215 dprintk("target: CPU %d should go to target freq: %d " 212 pr_debug("target: CPU %d should go to target freq: %d "
216 "(virtual) input_offset is 0x%x\n", 213 "(virtual) input_offset is 0x%p\n",
217 cpu, target_freq, 214 cpu, target_freq,
218 (pcch_virt_addr + pcc_cpu_data->input_offset)); 215 (pcch_virt_addr + pcc_cpu_data->input_offset));
219 216
@@ -234,14 +231,14 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
234 231
235 status = ioread16(&pcch_hdr->status); 232 status = ioread16(&pcch_hdr->status);
236 if (status != CMD_COMPLETE) { 233 if (status != CMD_COMPLETE) {
237 dprintk("target: FAILED for cpu %d, with status: 0x%x\n", 234 pr_debug("target: FAILED for cpu %d, with status: 0x%x\n",
238 cpu, status); 235 cpu, status);
239 goto cmd_incomplete; 236 goto cmd_incomplete;
240 } 237 }
241 iowrite16(0, &pcch_hdr->status); 238 iowrite16(0, &pcch_hdr->status);
242 239
243 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 240 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
244 dprintk("target: was SUCCESSFUL for cpu %d\n", cpu); 241 pr_debug("target: was SUCCESSFUL for cpu %d\n", cpu);
245 spin_unlock(&pcc_lock); 242 spin_unlock(&pcc_lock);
246 243
247 return 0; 244 return 0;
@@ -293,7 +290,7 @@ static int pcc_get_offset(int cpu)
293 memset_io((pcch_virt_addr + pcc_cpu_data->input_offset), 0, BUF_SZ); 290 memset_io((pcch_virt_addr + pcc_cpu_data->input_offset), 0, BUF_SZ);
294 memset_io((pcch_virt_addr + pcc_cpu_data->output_offset), 0, BUF_SZ); 291 memset_io((pcch_virt_addr + pcc_cpu_data->output_offset), 0, BUF_SZ);
295 292
296 dprintk("pcc_get_offset: for CPU %d: pcc_cpu_data " 293 pr_debug("pcc_get_offset: for CPU %d: pcc_cpu_data "
297 "input_offset: 0x%x, pcc_cpu_data output_offset: 0x%x\n", 294 "input_offset: 0x%x, pcc_cpu_data output_offset: 0x%x\n",
298 cpu, pcc_cpu_data->input_offset, pcc_cpu_data->output_offset); 295 cpu, pcc_cpu_data->input_offset, pcc_cpu_data->output_offset);
299out_free: 296out_free:
@@ -410,7 +407,7 @@ static int __init pcc_cpufreq_probe(void)
410 if (ACPI_SUCCESS(status)) { 407 if (ACPI_SUCCESS(status)) {
411 ret = pcc_cpufreq_do_osc(&osc_handle); 408 ret = pcc_cpufreq_do_osc(&osc_handle);
412 if (ret) 409 if (ret)
413 dprintk("probe: _OSC evaluation did not succeed\n"); 410 pr_debug("probe: _OSC evaluation did not succeed\n");
414 /* Firmware's use of _OSC is optional */ 411 /* Firmware's use of _OSC is optional */
415 ret = 0; 412 ret = 0;
416 } 413 }
@@ -433,7 +430,7 @@ static int __init pcc_cpufreq_probe(void)
433 430
434 mem_resource = (struct pcc_memory_resource *)member->buffer.pointer; 431 mem_resource = (struct pcc_memory_resource *)member->buffer.pointer;
435 432
436 dprintk("probe: mem_resource descriptor: 0x%x," 433 pr_debug("probe: mem_resource descriptor: 0x%x,"
437 " length: %d, space_id: %d, resource_usage: %d," 434 " length: %d, space_id: %d, resource_usage: %d,"
438 " type_specific: %d, granularity: 0x%llx," 435 " type_specific: %d, granularity: 0x%llx,"
439 " minimum: 0x%llx, maximum: 0x%llx," 436 " minimum: 0x%llx, maximum: 0x%llx,"
@@ -453,13 +450,13 @@ static int __init pcc_cpufreq_probe(void)
453 pcch_virt_addr = ioremap_nocache(mem_resource->minimum, 450 pcch_virt_addr = ioremap_nocache(mem_resource->minimum,
454 mem_resource->address_length); 451 mem_resource->address_length);
455 if (pcch_virt_addr == NULL) { 452 if (pcch_virt_addr == NULL) {
456 dprintk("probe: could not map shared mem region\n"); 453 pr_debug("probe: could not map shared mem region\n");
457 goto out_free; 454 goto out_free;
458 } 455 }
459 pcch_hdr = pcch_virt_addr; 456 pcch_hdr = pcch_virt_addr;
460 457
461 dprintk("probe: PCCH header (virtual) addr: 0x%p\n", pcch_hdr); 458 pr_debug("probe: PCCH header (virtual) addr: 0x%p\n", pcch_hdr);
462 dprintk("probe: PCCH header is at physical address: 0x%llx," 459 pr_debug("probe: PCCH header is at physical address: 0x%llx,"
463 " signature: 0x%x, length: %d bytes, major: %d, minor: %d," 460 " signature: 0x%x, length: %d bytes, major: %d, minor: %d,"
464 " supported features: 0x%x, command field: 0x%x," 461 " supported features: 0x%x, command field: 0x%x,"
465 " status field: 0x%x, nominal latency: %d us\n", 462 " status field: 0x%x, nominal latency: %d us\n",
@@ -469,7 +466,7 @@ static int __init pcc_cpufreq_probe(void)
469 ioread16(&pcch_hdr->command), ioread16(&pcch_hdr->status), 466 ioread16(&pcch_hdr->command), ioread16(&pcch_hdr->status),
470 ioread32(&pcch_hdr->latency)); 467 ioread32(&pcch_hdr->latency));
471 468
472 dprintk("probe: min time between commands: %d us," 469 pr_debug("probe: min time between commands: %d us,"
473 " max time between commands: %d us," 470 " max time between commands: %d us,"
474 " nominal CPU frequency: %d MHz," 471 " nominal CPU frequency: %d MHz,"
475 " minimum CPU frequency: %d MHz," 472 " minimum CPU frequency: %d MHz,"
@@ -494,7 +491,7 @@ static int __init pcc_cpufreq_probe(void)
494 doorbell.access_width = 64; 491 doorbell.access_width = 64;
495 doorbell.address = reg_resource->address; 492 doorbell.address = reg_resource->address;
496 493
497 dprintk("probe: doorbell: space_id is %d, bit_width is %d, " 494 pr_debug("probe: doorbell: space_id is %d, bit_width is %d, "
498 "bit_offset is %d, access_width is %d, address is 0x%llx\n", 495 "bit_offset is %d, access_width is %d, address is 0x%llx\n",
499 doorbell.space_id, doorbell.bit_width, doorbell.bit_offset, 496 doorbell.space_id, doorbell.bit_width, doorbell.bit_offset,
500 doorbell.access_width, reg_resource->address); 497 doorbell.access_width, reg_resource->address);
@@ -515,7 +512,7 @@ static int __init pcc_cpufreq_probe(void)
515 512
516 doorbell_write = member->integer.value; 513 doorbell_write = member->integer.value;
517 514
518 dprintk("probe: doorbell_preserve: 0x%llx," 515 pr_debug("probe: doorbell_preserve: 0x%llx,"
519 " doorbell_write: 0x%llx\n", 516 " doorbell_write: 0x%llx\n",
520 doorbell_preserve, doorbell_write); 517 doorbell_preserve, doorbell_write);
521 518
@@ -550,7 +547,7 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
550 547
551 result = pcc_get_offset(cpu); 548 result = pcc_get_offset(cpu);
552 if (result) { 549 if (result) {
553 dprintk("init: PCCP evaluation failed\n"); 550 pr_debug("init: PCCP evaluation failed\n");
554 goto out; 551 goto out;
555 } 552 }
556 553
@@ -561,12 +558,12 @@ static int pcc_cpufreq_cpu_init(struct cpufreq_policy *policy)
561 policy->cur = pcc_get_freq(cpu); 558 policy->cur = pcc_get_freq(cpu);
562 559
563 if (!policy->cur) { 560 if (!policy->cur) {
564 dprintk("init: Unable to get current CPU frequency\n"); 561 pr_debug("init: Unable to get current CPU frequency\n");
565 result = -EINVAL; 562 result = -EINVAL;
566 goto out; 563 goto out;
567 } 564 }
568 565
569 dprintk("init: policy->max is %d, policy->min is %d\n", 566 pr_debug("init: policy->max is %d, policy->min is %d\n",
570 policy->max, policy->min); 567 policy->max, policy->min);
571out: 568out:
572 return result; 569 return result;
@@ -597,7 +594,7 @@ static int __init pcc_cpufreq_init(void)
597 594
598 ret = pcc_cpufreq_probe(); 595 ret = pcc_cpufreq_probe();
599 if (ret) { 596 if (ret) {
600 dprintk("pcc_cpufreq_init: PCCH evaluation failed\n"); 597 pr_debug("pcc_cpufreq_init: PCCH evaluation failed\n");
601 return ret; 598 return ret;
602 } 599 }
603 600
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
index 4a45fd6e41ba..d71d9f372359 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
@@ -68,7 +68,6 @@ union powernow_acpi_control_t {
68}; 68};
69#endif 69#endif
70 70
71#ifdef CONFIG_CPU_FREQ_DEBUG
72/* divide by 1000 to get VCore voltage in V. */ 71/* divide by 1000 to get VCore voltage in V. */
73static const int mobile_vid_table[32] = { 72static const int mobile_vid_table[32] = {
74 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, 73 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650,
@@ -76,7 +75,6 @@ static const int mobile_vid_table[32] = {
76 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, 75 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100,
77 1075, 1050, 1025, 1000, 975, 950, 925, 0, 76 1075, 1050, 1025, 1000, 975, 950, 925, 0,
78}; 77};
79#endif
80 78
81/* divide by 10 to get FID. */ 79/* divide by 10 to get FID. */
82static const int fid_codes[32] = { 80static const int fid_codes[32] = {
@@ -103,9 +101,6 @@ static unsigned int fsb;
103static unsigned int latency; 101static unsigned int latency;
104static char have_a0; 102static char have_a0;
105 103
106#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
107 "powernow-k7", msg)
108
109static int check_fsb(unsigned int fsbspeed) 104static int check_fsb(unsigned int fsbspeed)
110{ 105{
111 int delta; 106 int delta;
@@ -209,7 +204,7 @@ static int get_ranges(unsigned char *pst)
209 vid = *pst++; 204 vid = *pst++;
210 powernow_table[j].index |= (vid << 8); /* upper 8 bits */ 205 powernow_table[j].index |= (vid << 8); /* upper 8 bits */
211 206
212 dprintk(" FID: 0x%x (%d.%dx [%dMHz]) " 207 pr_debug(" FID: 0x%x (%d.%dx [%dMHz]) "
213 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, 208 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
214 fid_codes[fid] % 10, speed/1000, vid, 209 fid_codes[fid] % 10, speed/1000, vid,
215 mobile_vid_table[vid]/1000, 210 mobile_vid_table[vid]/1000,
@@ -367,7 +362,7 @@ static int powernow_acpi_init(void)
367 unsigned int speed, speed_mhz; 362 unsigned int speed, speed_mhz;
368 363
369 pc.val = (unsigned long) state->control; 364 pc.val = (unsigned long) state->control;
370 dprintk("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n", 365 pr_debug("acpi: P%d: %d MHz %d mW %d uS control %08x SGTC %d\n",
371 i, 366 i,
372 (u32) state->core_frequency, 367 (u32) state->core_frequency,
373 (u32) state->power, 368 (u32) state->power,
@@ -401,7 +396,7 @@ static int powernow_acpi_init(void)
401 invalidate_entry(i); 396 invalidate_entry(i);
402 } 397 }
403 398
404 dprintk(" FID: 0x%x (%d.%dx [%dMHz]) " 399 pr_debug(" FID: 0x%x (%d.%dx [%dMHz]) "
405 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10, 400 "VID: 0x%x (%d.%03dV)\n", fid, fid_codes[fid] / 10,
406 fid_codes[fid] % 10, speed_mhz, vid, 401 fid_codes[fid] % 10, speed_mhz, vid,
407 mobile_vid_table[vid]/1000, 402 mobile_vid_table[vid]/1000,
@@ -409,7 +404,7 @@ static int powernow_acpi_init(void)
409 404
410 if (state->core_frequency != speed_mhz) { 405 if (state->core_frequency != speed_mhz) {
411 state->core_frequency = speed_mhz; 406 state->core_frequency = speed_mhz;
412 dprintk(" Corrected ACPI frequency to %d\n", 407 pr_debug(" Corrected ACPI frequency to %d\n",
413 speed_mhz); 408 speed_mhz);
414 } 409 }
415 410
@@ -453,8 +448,8 @@ static int powernow_acpi_init(void)
453 448
454static void print_pst_entry(struct pst_s *pst, unsigned int j) 449static void print_pst_entry(struct pst_s *pst, unsigned int j)
455{ 450{
456 dprintk("PST:%d (@%p)\n", j, pst); 451 pr_debug("PST:%d (@%p)\n", j, pst);
457 dprintk(" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n", 452 pr_debug(" cpuid: 0x%x fsb: %d maxFID: 0x%x startvid: 0x%x\n",
458 pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid); 453 pst->cpuid, pst->fsbspeed, pst->maxfid, pst->startvid);
459} 454}
460 455
@@ -474,20 +469,20 @@ static int powernow_decode_bios(int maxfid, int startvid)
474 p = phys_to_virt(i); 469 p = phys_to_virt(i);
475 470
476 if (memcmp(p, "AMDK7PNOW!", 10) == 0) { 471 if (memcmp(p, "AMDK7PNOW!", 10) == 0) {
477 dprintk("Found PSB header at %p\n", p); 472 pr_debug("Found PSB header at %p\n", p);
478 psb = (struct psb_s *) p; 473 psb = (struct psb_s *) p;
479 dprintk("Table version: 0x%x\n", psb->tableversion); 474 pr_debug("Table version: 0x%x\n", psb->tableversion);
480 if (psb->tableversion != 0x12) { 475 if (psb->tableversion != 0x12) {
481 printk(KERN_INFO PFX "Sorry, only v1.2 tables" 476 printk(KERN_INFO PFX "Sorry, only v1.2 tables"
482 " supported right now\n"); 477 " supported right now\n");
483 return -ENODEV; 478 return -ENODEV;
484 } 479 }
485 480
486 dprintk("Flags: 0x%x\n", psb->flags); 481 pr_debug("Flags: 0x%x\n", psb->flags);
487 if ((psb->flags & 1) == 0) 482 if ((psb->flags & 1) == 0)
488 dprintk("Mobile voltage regulator\n"); 483 pr_debug("Mobile voltage regulator\n");
489 else 484 else
490 dprintk("Desktop voltage regulator\n"); 485 pr_debug("Desktop voltage regulator\n");
491 486
492 latency = psb->settlingtime; 487 latency = psb->settlingtime;
493 if (latency < 100) { 488 if (latency < 100) {
@@ -497,9 +492,9 @@ static int powernow_decode_bios(int maxfid, int startvid)
497 "Correcting.\n", latency); 492 "Correcting.\n", latency);
498 latency = 100; 493 latency = 100;
499 } 494 }
500 dprintk("Settling Time: %d microseconds.\n", 495 pr_debug("Settling Time: %d microseconds.\n",
501 psb->settlingtime); 496 psb->settlingtime);
502 dprintk("Has %d PST tables. (Only dumping ones " 497 pr_debug("Has %d PST tables. (Only dumping ones "
503 "relevant to this CPU).\n", 498 "relevant to this CPU).\n",
504 psb->numpst); 499 psb->numpst);
505 500
@@ -650,7 +645,7 @@ static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy)
650 printk(KERN_WARNING PFX "can not determine bus frequency\n"); 645 printk(KERN_WARNING PFX "can not determine bus frequency\n");
651 return -EINVAL; 646 return -EINVAL;
652 } 647 }
653 dprintk("FSB: %3dMHz\n", fsb/1000); 648 pr_debug("FSB: %3dMHz\n", fsb/1000);
654 649
655 if (dmi_check_system(powernow_dmi_table) || acpi_force) { 650 if (dmi_check_system(powernow_dmi_table) || acpi_force) {
656 printk(KERN_INFO PFX "PSB/PST known to be broken. " 651 printk(KERN_INFO PFX "PSB/PST known to be broken. "
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 2368e38327b3..83479b6fb9a1 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -139,7 +139,7 @@ static int query_current_values_with_pending_wait(struct powernow_k8_data *data)
139 } 139 }
140 do { 140 do {
141 if (i++ > 10000) { 141 if (i++ > 10000) {
142 dprintk("detected change pending stuck\n"); 142 pr_debug("detected change pending stuck\n");
143 return 1; 143 return 1;
144 } 144 }
145 rdmsr(MSR_FIDVID_STATUS, lo, hi); 145 rdmsr(MSR_FIDVID_STATUS, lo, hi);
@@ -176,7 +176,7 @@ static void fidvid_msr_init(void)
176 fid = lo & MSR_S_LO_CURRENT_FID; 176 fid = lo & MSR_S_LO_CURRENT_FID;
177 lo = fid | (vid << MSR_C_LO_VID_SHIFT); 177 lo = fid | (vid << MSR_C_LO_VID_SHIFT);
178 hi = MSR_C_HI_STP_GNT_BENIGN; 178 hi = MSR_C_HI_STP_GNT_BENIGN;
179 dprintk("cpu%d, init lo 0x%x, hi 0x%x\n", smp_processor_id(), lo, hi); 179 pr_debug("cpu%d, init lo 0x%x, hi 0x%x\n", smp_processor_id(), lo, hi);
180 wrmsr(MSR_FIDVID_CTL, lo, hi); 180 wrmsr(MSR_FIDVID_CTL, lo, hi);
181} 181}
182 182
@@ -196,7 +196,7 @@ static int write_new_fid(struct powernow_k8_data *data, u32 fid)
196 lo |= (data->currvid << MSR_C_LO_VID_SHIFT); 196 lo |= (data->currvid << MSR_C_LO_VID_SHIFT);
197 lo |= MSR_C_LO_INIT_FID_VID; 197 lo |= MSR_C_LO_INIT_FID_VID;
198 198
199 dprintk("writing fid 0x%x, lo 0x%x, hi 0x%x\n", 199 pr_debug("writing fid 0x%x, lo 0x%x, hi 0x%x\n",
200 fid, lo, data->plllock * PLL_LOCK_CONVERSION); 200 fid, lo, data->plllock * PLL_LOCK_CONVERSION);
201 201
202 do { 202 do {
@@ -244,7 +244,7 @@ static int write_new_vid(struct powernow_k8_data *data, u32 vid)
244 lo |= (vid << MSR_C_LO_VID_SHIFT); 244 lo |= (vid << MSR_C_LO_VID_SHIFT);
245 lo |= MSR_C_LO_INIT_FID_VID; 245 lo |= MSR_C_LO_INIT_FID_VID;
246 246
247 dprintk("writing vid 0x%x, lo 0x%x, hi 0x%x\n", 247 pr_debug("writing vid 0x%x, lo 0x%x, hi 0x%x\n",
248 vid, lo, STOP_GRANT_5NS); 248 vid, lo, STOP_GRANT_5NS);
249 249
250 do { 250 do {
@@ -325,7 +325,7 @@ static int transition_fid_vid(struct powernow_k8_data *data,
325 return 1; 325 return 1;
326 } 326 }
327 327
328 dprintk("transitioned (cpu%d): new fid 0x%x, vid 0x%x\n", 328 pr_debug("transitioned (cpu%d): new fid 0x%x, vid 0x%x\n",
329 smp_processor_id(), data->currfid, data->currvid); 329 smp_processor_id(), data->currfid, data->currvid);
330 330
331 return 0; 331 return 0;
@@ -339,7 +339,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
339 u32 savefid = data->currfid; 339 u32 savefid = data->currfid;
340 u32 maxvid, lo, rvomult = 1; 340 u32 maxvid, lo, rvomult = 1;
341 341
342 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, " 342 pr_debug("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, "
343 "reqvid 0x%x, rvo 0x%x\n", 343 "reqvid 0x%x, rvo 0x%x\n",
344 smp_processor_id(), 344 smp_processor_id(),
345 data->currfid, data->currvid, reqvid, data->rvo); 345 data->currfid, data->currvid, reqvid, data->rvo);
@@ -349,12 +349,12 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
349 rvosteps *= rvomult; 349 rvosteps *= rvomult;
350 rdmsr(MSR_FIDVID_STATUS, lo, maxvid); 350 rdmsr(MSR_FIDVID_STATUS, lo, maxvid);
351 maxvid = 0x1f & (maxvid >> 16); 351 maxvid = 0x1f & (maxvid >> 16);
352 dprintk("ph1 maxvid=0x%x\n", maxvid); 352 pr_debug("ph1 maxvid=0x%x\n", maxvid);
353 if (reqvid < maxvid) /* lower numbers are higher voltages */ 353 if (reqvid < maxvid) /* lower numbers are higher voltages */
354 reqvid = maxvid; 354 reqvid = maxvid;
355 355
356 while (data->currvid > reqvid) { 356 while (data->currvid > reqvid) {
357 dprintk("ph1: curr 0x%x, req vid 0x%x\n", 357 pr_debug("ph1: curr 0x%x, req vid 0x%x\n",
358 data->currvid, reqvid); 358 data->currvid, reqvid);
359 if (decrease_vid_code_by_step(data, reqvid, data->vidmvs)) 359 if (decrease_vid_code_by_step(data, reqvid, data->vidmvs))
360 return 1; 360 return 1;
@@ -365,7 +365,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
365 if (data->currvid == maxvid) { 365 if (data->currvid == maxvid) {
366 rvosteps = 0; 366 rvosteps = 0;
367 } else { 367 } else {
368 dprintk("ph1: changing vid for rvo, req 0x%x\n", 368 pr_debug("ph1: changing vid for rvo, req 0x%x\n",
369 data->currvid - 1); 369 data->currvid - 1);
370 if (decrease_vid_code_by_step(data, data->currvid-1, 1)) 370 if (decrease_vid_code_by_step(data, data->currvid-1, 1))
371 return 1; 371 return 1;
@@ -382,7 +382,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
382 return 1; 382 return 1;
383 } 383 }
384 384
385 dprintk("ph1 complete, currfid 0x%x, currvid 0x%x\n", 385 pr_debug("ph1 complete, currfid 0x%x, currvid 0x%x\n",
386 data->currfid, data->currvid); 386 data->currfid, data->currvid);
387 387
388 return 0; 388 return 0;
@@ -400,7 +400,7 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
400 return 0; 400 return 0;
401 } 401 }
402 402
403 dprintk("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, " 403 pr_debug("ph2 (cpu%d): starting, currfid 0x%x, currvid 0x%x, "
404 "reqfid 0x%x\n", 404 "reqfid 0x%x\n",
405 smp_processor_id(), 405 smp_processor_id(),
406 data->currfid, data->currvid, reqfid); 406 data->currfid, data->currvid, reqfid);
@@ -457,7 +457,7 @@ static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid)
457 return 1; 457 return 1;
458 } 458 }
459 459
460 dprintk("ph2 complete, currfid 0x%x, currvid 0x%x\n", 460 pr_debug("ph2 complete, currfid 0x%x, currvid 0x%x\n",
461 data->currfid, data->currvid); 461 data->currfid, data->currvid);
462 462
463 return 0; 463 return 0;
@@ -470,7 +470,7 @@ static int core_voltage_post_transition(struct powernow_k8_data *data,
470 u32 savefid = data->currfid; 470 u32 savefid = data->currfid;
471 u32 savereqvid = reqvid; 471 u32 savereqvid = reqvid;
472 472
473 dprintk("ph3 (cpu%d): starting, currfid 0x%x, currvid 0x%x\n", 473 pr_debug("ph3 (cpu%d): starting, currfid 0x%x, currvid 0x%x\n",
474 smp_processor_id(), 474 smp_processor_id(),
475 data->currfid, data->currvid); 475 data->currfid, data->currvid);
476 476
@@ -498,17 +498,17 @@ static int core_voltage_post_transition(struct powernow_k8_data *data,
498 return 1; 498 return 1;
499 499
500 if (savereqvid != data->currvid) { 500 if (savereqvid != data->currvid) {
501 dprintk("ph3 failed, currvid 0x%x\n", data->currvid); 501 pr_debug("ph3 failed, currvid 0x%x\n", data->currvid);
502 return 1; 502 return 1;
503 } 503 }
504 504
505 if (savefid != data->currfid) { 505 if (savefid != data->currfid) {
506 dprintk("ph3 failed, currfid changed 0x%x\n", 506 pr_debug("ph3 failed, currfid changed 0x%x\n",
507 data->currfid); 507 data->currfid);
508 return 1; 508 return 1;
509 } 509 }
510 510
511 dprintk("ph3 complete, currfid 0x%x, currvid 0x%x\n", 511 pr_debug("ph3 complete, currfid 0x%x, currvid 0x%x\n",
512 data->currfid, data->currvid); 512 data->currfid, data->currvid);
513 513
514 return 0; 514 return 0;
@@ -707,7 +707,7 @@ static int fill_powernow_table(struct powernow_k8_data *data,
707 return -EIO; 707 return -EIO;
708 } 708 }
709 709
710 dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid); 710 pr_debug("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
711 data->powernow_table = powernow_table; 711 data->powernow_table = powernow_table;
712 if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu) 712 if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
713 print_basics(data); 713 print_basics(data);
@@ -717,7 +717,7 @@ static int fill_powernow_table(struct powernow_k8_data *data,
717 (pst[j].vid == data->currvid)) 717 (pst[j].vid == data->currvid))
718 return 0; 718 return 0;
719 719
720 dprintk("currfid/vid do not match PST, ignoring\n"); 720 pr_debug("currfid/vid do not match PST, ignoring\n");
721 return 0; 721 return 0;
722} 722}
723 723
@@ -739,36 +739,36 @@ static int find_psb_table(struct powernow_k8_data *data)
739 if (memcmp(psb, PSB_ID_STRING, PSB_ID_STRING_LEN) != 0) 739 if (memcmp(psb, PSB_ID_STRING, PSB_ID_STRING_LEN) != 0)
740 continue; 740 continue;
741 741
742 dprintk("found PSB header at 0x%p\n", psb); 742 pr_debug("found PSB header at 0x%p\n", psb);
743 743
744 dprintk("table vers: 0x%x\n", psb->tableversion); 744 pr_debug("table vers: 0x%x\n", psb->tableversion);
745 if (psb->tableversion != PSB_VERSION_1_4) { 745 if (psb->tableversion != PSB_VERSION_1_4) {
746 printk(KERN_ERR FW_BUG PFX "PSB table is not v1.4\n"); 746 printk(KERN_ERR FW_BUG PFX "PSB table is not v1.4\n");
747 return -ENODEV; 747 return -ENODEV;
748 } 748 }
749 749
750 dprintk("flags: 0x%x\n", psb->flags1); 750 pr_debug("flags: 0x%x\n", psb->flags1);
751 if (psb->flags1) { 751 if (psb->flags1) {
752 printk(KERN_ERR FW_BUG PFX "unknown flags\n"); 752 printk(KERN_ERR FW_BUG PFX "unknown flags\n");
753 return -ENODEV; 753 return -ENODEV;
754 } 754 }
755 755
756 data->vstable = psb->vstable; 756 data->vstable = psb->vstable;
757 dprintk("voltage stabilization time: %d(*20us)\n", 757 pr_debug("voltage stabilization time: %d(*20us)\n",
758 data->vstable); 758 data->vstable);
759 759
760 dprintk("flags2: 0x%x\n", psb->flags2); 760 pr_debug("flags2: 0x%x\n", psb->flags2);
761 data->rvo = psb->flags2 & 3; 761 data->rvo = psb->flags2 & 3;
762 data->irt = ((psb->flags2) >> 2) & 3; 762 data->irt = ((psb->flags2) >> 2) & 3;
763 mvs = ((psb->flags2) >> 4) & 3; 763 mvs = ((psb->flags2) >> 4) & 3;
764 data->vidmvs = 1 << mvs; 764 data->vidmvs = 1 << mvs;
765 data->batps = ((psb->flags2) >> 6) & 3; 765 data->batps = ((psb->flags2) >> 6) & 3;
766 766
767 dprintk("ramp voltage offset: %d\n", data->rvo); 767 pr_debug("ramp voltage offset: %d\n", data->rvo);
768 dprintk("isochronous relief time: %d\n", data->irt); 768 pr_debug("isochronous relief time: %d\n", data->irt);
769 dprintk("maximum voltage step: %d - 0x%x\n", mvs, data->vidmvs); 769 pr_debug("maximum voltage step: %d - 0x%x\n", mvs, data->vidmvs);
770 770
771 dprintk("numpst: 0x%x\n", psb->num_tables); 771 pr_debug("numpst: 0x%x\n", psb->num_tables);
772 cpst = psb->num_tables; 772 cpst = psb->num_tables;
773 if ((psb->cpuid == 0x00000fc0) || 773 if ((psb->cpuid == 0x00000fc0) ||
774 (psb->cpuid == 0x00000fe0)) { 774 (psb->cpuid == 0x00000fe0)) {
@@ -783,13 +783,13 @@ static int find_psb_table(struct powernow_k8_data *data)
783 } 783 }
784 784
785 data->plllock = psb->plllocktime; 785 data->plllock = psb->plllocktime;
786 dprintk("plllocktime: 0x%x (units 1us)\n", psb->plllocktime); 786 pr_debug("plllocktime: 0x%x (units 1us)\n", psb->plllocktime);
787 dprintk("maxfid: 0x%x\n", psb->maxfid); 787 pr_debug("maxfid: 0x%x\n", psb->maxfid);
788 dprintk("maxvid: 0x%x\n", psb->maxvid); 788 pr_debug("maxvid: 0x%x\n", psb->maxvid);
789 maxvid = psb->maxvid; 789 maxvid = psb->maxvid;
790 790
791 data->numps = psb->numps; 791 data->numps = psb->numps;
792 dprintk("numpstates: 0x%x\n", data->numps); 792 pr_debug("numpstates: 0x%x\n", data->numps);
793 return fill_powernow_table(data, 793 return fill_powernow_table(data,
794 (struct pst_s *)(psb+1), maxvid); 794 (struct pst_s *)(psb+1), maxvid);
795 } 795 }
@@ -834,13 +834,13 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
834 u64 control, status; 834 u64 control, status;
835 835
836 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) { 836 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {
837 dprintk("register performance failed: bad ACPI data\n"); 837 pr_debug("register performance failed: bad ACPI data\n");
838 return -EIO; 838 return -EIO;
839 } 839 }
840 840
841 /* verify the data contained in the ACPI structures */ 841 /* verify the data contained in the ACPI structures */
842 if (data->acpi_data.state_count <= 1) { 842 if (data->acpi_data.state_count <= 1) {
843 dprintk("No ACPI P-States\n"); 843 pr_debug("No ACPI P-States\n");
844 goto err_out; 844 goto err_out;
845 } 845 }
846 846
@@ -849,7 +849,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
849 849
850 if ((control != ACPI_ADR_SPACE_FIXED_HARDWARE) || 850 if ((control != ACPI_ADR_SPACE_FIXED_HARDWARE) ||
851 (status != ACPI_ADR_SPACE_FIXED_HARDWARE)) { 851 (status != ACPI_ADR_SPACE_FIXED_HARDWARE)) {
852 dprintk("Invalid control/status registers (%x - %x)\n", 852 pr_debug("Invalid control/status registers (%llx - %llx)\n",
853 control, status); 853 control, status);
854 goto err_out; 854 goto err_out;
855 } 855 }
@@ -858,7 +858,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
858 powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) 858 powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table)
859 * (data->acpi_data.state_count + 1)), GFP_KERNEL); 859 * (data->acpi_data.state_count + 1)), GFP_KERNEL);
860 if (!powernow_table) { 860 if (!powernow_table) {
861 dprintk("powernow_table memory alloc failure\n"); 861 pr_debug("powernow_table memory alloc failure\n");
862 goto err_out; 862 goto err_out;
863 } 863 }
864 864
@@ -928,7 +928,7 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
928 } 928 }
929 rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi); 929 rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
930 if (!(hi & HW_PSTATE_VALID_MASK)) { 930 if (!(hi & HW_PSTATE_VALID_MASK)) {
931 dprintk("invalid pstate %d, ignoring\n", index); 931 pr_debug("invalid pstate %d, ignoring\n", index);
932 invalidate_entry(powernow_table, i); 932 invalidate_entry(powernow_table, i);
933 continue; 933 continue;
934 } 934 }
@@ -968,7 +968,7 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data,
968 vid = (control >> VID_SHIFT) & VID_MASK; 968 vid = (control >> VID_SHIFT) & VID_MASK;
969 } 969 }
970 970
971 dprintk(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid); 971 pr_debug(" %d : fid 0x%x, vid 0x%x\n", i, fid, vid);
972 972
973 index = fid | (vid<<8); 973 index = fid | (vid<<8);
974 powernow_table[i].index = index; 974 powernow_table[i].index = index;
@@ -978,7 +978,7 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data,
978 978
979 /* verify frequency is OK */ 979 /* verify frequency is OK */
980 if ((freq > (MAX_FREQ * 1000)) || (freq < (MIN_FREQ * 1000))) { 980 if ((freq > (MAX_FREQ * 1000)) || (freq < (MIN_FREQ * 1000))) {
981 dprintk("invalid freq %u kHz, ignoring\n", freq); 981 pr_debug("invalid freq %u kHz, ignoring\n", freq);
982 invalidate_entry(powernow_table, i); 982 invalidate_entry(powernow_table, i);
983 continue; 983 continue;
984 } 984 }
@@ -986,7 +986,7 @@ static int fill_powernow_table_fidvid(struct powernow_k8_data *data,
986 /* verify voltage is OK - 986 /* verify voltage is OK -
987 * BIOSs are using "off" to indicate invalid */ 987 * BIOSs are using "off" to indicate invalid */
988 if (vid == VID_OFF) { 988 if (vid == VID_OFF) {
989 dprintk("invalid vid %u, ignoring\n", vid); 989 pr_debug("invalid vid %u, ignoring\n", vid);
990 invalidate_entry(powernow_table, i); 990 invalidate_entry(powernow_table, i);
991 continue; 991 continue;
992 } 992 }
@@ -1047,7 +1047,7 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
1047 int res, i; 1047 int res, i;
1048 struct cpufreq_freqs freqs; 1048 struct cpufreq_freqs freqs;
1049 1049
1050 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index); 1050 pr_debug("cpu %d transition to index %u\n", smp_processor_id(), index);
1051 1051
1052 /* fid/vid correctness check for k8 */ 1052 /* fid/vid correctness check for k8 */
1053 /* fid are the lower 8 bits of the index we stored into 1053 /* fid are the lower 8 bits of the index we stored into
@@ -1057,18 +1057,18 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data,
1057 fid = data->powernow_table[index].index & 0xFF; 1057 fid = data->powernow_table[index].index & 0xFF;
1058 vid = (data->powernow_table[index].index & 0xFF00) >> 8; 1058 vid = (data->powernow_table[index].index & 0xFF00) >> 8;
1059 1059
1060 dprintk("table matched fid 0x%x, giving vid 0x%x\n", fid, vid); 1060 pr_debug("table matched fid 0x%x, giving vid 0x%x\n", fid, vid);
1061 1061
1062 if (query_current_values_with_pending_wait(data)) 1062 if (query_current_values_with_pending_wait(data))
1063 return 1; 1063 return 1;
1064 1064
1065 if ((data->currvid == vid) && (data->currfid == fid)) { 1065 if ((data->currvid == vid) && (data->currfid == fid)) {
1066 dprintk("target matches current values (fid 0x%x, vid 0x%x)\n", 1066 pr_debug("target matches current values (fid 0x%x, vid 0x%x)\n",
1067 fid, vid); 1067 fid, vid);
1068 return 0; 1068 return 0;
1069 } 1069 }
1070 1070
1071 dprintk("cpu %d, changing to fid 0x%x, vid 0x%x\n", 1071 pr_debug("cpu %d, changing to fid 0x%x, vid 0x%x\n",
1072 smp_processor_id(), fid, vid); 1072 smp_processor_id(), fid, vid);
1073 freqs.old = find_khz_freq_from_fid(data->currfid); 1073 freqs.old = find_khz_freq_from_fid(data->currfid);
1074 freqs.new = find_khz_freq_from_fid(fid); 1074 freqs.new = find_khz_freq_from_fid(fid);
@@ -1096,7 +1096,7 @@ static int transition_frequency_pstate(struct powernow_k8_data *data,
1096 int res, i; 1096 int res, i;
1097 struct cpufreq_freqs freqs; 1097 struct cpufreq_freqs freqs;
1098 1098
1099 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index); 1099 pr_debug("cpu %d transition to index %u\n", smp_processor_id(), index);
1100 1100
1101 /* get MSR index for hardware pstate transition */ 1101 /* get MSR index for hardware pstate transition */
1102 pstate = index & HW_PSTATE_MASK; 1102 pstate = index & HW_PSTATE_MASK;
@@ -1156,14 +1156,14 @@ static int powernowk8_target(struct cpufreq_policy *pol,
1156 goto err_out; 1156 goto err_out;
1157 } 1157 }
1158 1158
1159 dprintk("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n", 1159 pr_debug("targ: cpu %d, %d kHz, min %d, max %d, relation %d\n",
1160 pol->cpu, targfreq, pol->min, pol->max, relation); 1160 pol->cpu, targfreq, pol->min, pol->max, relation);
1161 1161
1162 if (query_current_values_with_pending_wait(data)) 1162 if (query_current_values_with_pending_wait(data))
1163 goto err_out; 1163 goto err_out;
1164 1164
1165 if (cpu_family != CPU_HW_PSTATE) { 1165 if (cpu_family != CPU_HW_PSTATE) {
1166 dprintk("targ: curr fid 0x%x, vid 0x%x\n", 1166 pr_debug("targ: curr fid 0x%x, vid 0x%x\n",
1167 data->currfid, data->currvid); 1167 data->currfid, data->currvid);
1168 1168
1169 if ((checkvid != data->currvid) || 1169 if ((checkvid != data->currvid) ||
@@ -1319,7 +1319,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1319 data->currpstate); 1319 data->currpstate);
1320 else 1320 else
1321 pol->cur = find_khz_freq_from_fid(data->currfid); 1321 pol->cur = find_khz_freq_from_fid(data->currfid);
1322 dprintk("policy current frequency %d kHz\n", pol->cur); 1322 pr_debug("policy current frequency %d kHz\n", pol->cur);
1323 1323
1324 /* min/max the cpu is capable of */ 1324 /* min/max the cpu is capable of */
1325 if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { 1325 if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) {
@@ -1337,10 +1337,10 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1337 cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu); 1337 cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu);
1338 1338
1339 if (cpu_family == CPU_HW_PSTATE) 1339 if (cpu_family == CPU_HW_PSTATE)
1340 dprintk("cpu_init done, current pstate 0x%x\n", 1340 pr_debug("cpu_init done, current pstate 0x%x\n",
1341 data->currpstate); 1341 data->currpstate);
1342 else 1342 else
1343 dprintk("cpu_init done, current fid 0x%x, vid 0x%x\n", 1343 pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n",
1344 data->currfid, data->currvid); 1344 data->currfid, data->currvid);
1345 1345
1346 per_cpu(powernow_data, pol->cpu) = data; 1346 per_cpu(powernow_data, pol->cpu) = data;
@@ -1586,7 +1586,7 @@ static int __cpuinit powernowk8_init(void)
1586/* driver entry point for term */ 1586/* driver entry point for term */
1587static void __exit powernowk8_exit(void) 1587static void __exit powernowk8_exit(void)
1588{ 1588{
1589 dprintk("exit\n"); 1589 pr_debug("exit\n");
1590 1590
1591 if (boot_cpu_has(X86_FEATURE_CPB)) { 1591 if (boot_cpu_has(X86_FEATURE_CPB)) {
1592 msrs_free(msrs); 1592 msrs_free(msrs);
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
index df3529b1c02d..3744d26cdc2b 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
@@ -211,8 +211,6 @@ struct pst_s {
211 u8 vid; 211 u8 vid;
212}; 212};
213 213
214#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "powernow-k8", msg)
215
216static int core_voltage_pre_transition(struct powernow_k8_data *data, 214static int core_voltage_pre_transition(struct powernow_k8_data *data,
217 u32 reqvid, u32 regfid); 215 u32 reqvid, u32 regfid);
218static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid); 216static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvid);
diff --git a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
index 435a996a613a..1e205e6b1727 100644
--- a/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
+++ b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
@@ -29,8 +29,6 @@
29 29
30static __u8 __iomem *cpuctl; 30static __u8 __iomem *cpuctl;
31 31
32#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
33 "sc520_freq", msg)
34#define PFX "sc520_freq: " 32#define PFX "sc520_freq: "
35 33
36static struct cpufreq_frequency_table sc520_freq_table[] = { 34static struct cpufreq_frequency_table sc520_freq_table[] = {
@@ -66,7 +64,7 @@ static void sc520_freq_set_cpu_state(unsigned int state)
66 64
67 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 65 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
68 66
69 dprintk("attempting to set frequency to %i kHz\n", 67 pr_debug("attempting to set frequency to %i kHz\n",
70 sc520_freq_table[state].frequency); 68 sc520_freq_table[state].frequency);
71 69
72 local_irq_disable(); 70 local_irq_disable();
@@ -161,7 +159,7 @@ static int __init sc520_freq_init(void)
161 /* Test if we have the right hardware */ 159 /* Test if we have the right hardware */
162 if (c->x86_vendor != X86_VENDOR_AMD || 160 if (c->x86_vendor != X86_VENDOR_AMD ||
163 c->x86 != 4 || c->x86_model != 9) { 161 c->x86 != 4 || c->x86_model != 9) {
164 dprintk("no Elan SC520 processor found!\n"); 162 pr_debug("no Elan SC520 processor found!\n");
165 return -ENODEV; 163 return -ENODEV;
166 } 164 }
167 cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1); 165 cpuctl = ioremap((unsigned long)(MMCR_BASE + OFFS_CPUCTL), 1);
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
index 9b1ff37de46a..6ea3455def21 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -29,9 +29,6 @@
29#define PFX "speedstep-centrino: " 29#define PFX "speedstep-centrino: "
30#define MAINTAINER "cpufreq@vger.kernel.org" 30#define MAINTAINER "cpufreq@vger.kernel.org"
31 31
32#define dprintk(msg...) \
33 cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-centrino", msg)
34
35#define INTEL_MSR_RANGE (0xffff) 32#define INTEL_MSR_RANGE (0xffff)
36 33
37struct cpu_id 34struct cpu_id
@@ -244,7 +241,7 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy)
244 241
245 if (model->cpu_id == NULL) { 242 if (model->cpu_id == NULL) {
246 /* No match at all */ 243 /* No match at all */
247 dprintk("no support for CPU model \"%s\": " 244 pr_debug("no support for CPU model \"%s\": "
248 "send /proc/cpuinfo to " MAINTAINER "\n", 245 "send /proc/cpuinfo to " MAINTAINER "\n",
249 cpu->x86_model_id); 246 cpu->x86_model_id);
250 return -ENOENT; 247 return -ENOENT;
@@ -252,15 +249,15 @@ static int centrino_cpu_init_table(struct cpufreq_policy *policy)
252 249
253 if (model->op_points == NULL) { 250 if (model->op_points == NULL) {
254 /* Matched a non-match */ 251 /* Matched a non-match */
255 dprintk("no table support for CPU model \"%s\"\n", 252 pr_debug("no table support for CPU model \"%s\"\n",
256 cpu->x86_model_id); 253 cpu->x86_model_id);
257 dprintk("try using the acpi-cpufreq driver\n"); 254 pr_debug("try using the acpi-cpufreq driver\n");
258 return -ENOENT; 255 return -ENOENT;
259 } 256 }
260 257
261 per_cpu(centrino_model, policy->cpu) = model; 258 per_cpu(centrino_model, policy->cpu) = model;
262 259
263 dprintk("found \"%s\": max frequency: %dkHz\n", 260 pr_debug("found \"%s\": max frequency: %dkHz\n",
264 model->model_name, model->max_freq); 261 model->model_name, model->max_freq);
265 262
266 return 0; 263 return 0;
@@ -369,7 +366,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
369 per_cpu(centrino_cpu, policy->cpu) = &cpu_ids[i]; 366 per_cpu(centrino_cpu, policy->cpu) = &cpu_ids[i];
370 367
371 if (!per_cpu(centrino_cpu, policy->cpu)) { 368 if (!per_cpu(centrino_cpu, policy->cpu)) {
372 dprintk("found unsupported CPU with " 369 pr_debug("found unsupported CPU with "
373 "Enhanced SpeedStep: send /proc/cpuinfo to " 370 "Enhanced SpeedStep: send /proc/cpuinfo to "
374 MAINTAINER "\n"); 371 MAINTAINER "\n");
375 return -ENODEV; 372 return -ENODEV;
@@ -385,7 +382,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
385 382
386 if (!(l & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) { 383 if (!(l & MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP)) {
387 l |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP; 384 l |= MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP;
388 dprintk("trying to enable Enhanced SpeedStep (%x)\n", l); 385 pr_debug("trying to enable Enhanced SpeedStep (%x)\n", l);
389 wrmsr(MSR_IA32_MISC_ENABLE, l, h); 386 wrmsr(MSR_IA32_MISC_ENABLE, l, h);
390 387
391 /* check to see if it stuck */ 388 /* check to see if it stuck */
@@ -402,7 +399,7 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
402 /* 10uS transition latency */ 399 /* 10uS transition latency */
403 policy->cur = freq; 400 policy->cur = freq;
404 401
405 dprintk("centrino_cpu_init: cur=%dkHz\n", policy->cur); 402 pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur);
406 403
407 ret = cpufreq_frequency_table_cpuinfo(policy, 404 ret = cpufreq_frequency_table_cpuinfo(policy,
408 per_cpu(centrino_model, policy->cpu)->op_points); 405 per_cpu(centrino_model, policy->cpu)->op_points);
@@ -498,7 +495,7 @@ static int centrino_target (struct cpufreq_policy *policy,
498 good_cpu = j; 495 good_cpu = j;
499 496
500 if (good_cpu >= nr_cpu_ids) { 497 if (good_cpu >= nr_cpu_ids) {
501 dprintk("couldn't limit to CPUs in this domain\n"); 498 pr_debug("couldn't limit to CPUs in this domain\n");
502 retval = -EAGAIN; 499 retval = -EAGAIN;
503 if (first_cpu) { 500 if (first_cpu) {
504 /* We haven't started the transition yet. */ 501 /* We haven't started the transition yet. */
@@ -512,7 +509,7 @@ static int centrino_target (struct cpufreq_policy *policy,
512 if (first_cpu) { 509 if (first_cpu) {
513 rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h); 510 rdmsr_on_cpu(good_cpu, MSR_IA32_PERF_CTL, &oldmsr, &h);
514 if (msr == (oldmsr & 0xffff)) { 511 if (msr == (oldmsr & 0xffff)) {
515 dprintk("no change needed - msr was and needs " 512 pr_debug("no change needed - msr was and needs "
516 "to be %x\n", oldmsr); 513 "to be %x\n", oldmsr);
517 retval = 0; 514 retval = 0;
518 goto out; 515 goto out;
@@ -521,7 +518,7 @@ static int centrino_target (struct cpufreq_policy *policy,
521 freqs.old = extract_clock(oldmsr, cpu, 0); 518 freqs.old = extract_clock(oldmsr, cpu, 0);
522 freqs.new = extract_clock(msr, cpu, 0); 519 freqs.new = extract_clock(msr, cpu, 0);
523 520
524 dprintk("target=%dkHz old=%d new=%d msr=%04x\n", 521 pr_debug("target=%dkHz old=%d new=%d msr=%04x\n",
525 target_freq, freqs.old, freqs.new, msr); 522 target_freq, freqs.old, freqs.new, msr);
526 523
527 for_each_cpu(k, policy->cpus) { 524 for_each_cpu(k, policy->cpus) {
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
index 561758e95180..a748ce782fee 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
@@ -53,10 +53,6 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
53}; 53};
54 54
55 55
56#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
57 "speedstep-ich", msg)
58
59
60/** 56/**
61 * speedstep_find_register - read the PMBASE address 57 * speedstep_find_register - read the PMBASE address
62 * 58 *
@@ -80,7 +76,7 @@ static int speedstep_find_register(void)
80 return -ENODEV; 76 return -ENODEV;
81 } 77 }
82 78
83 dprintk("pmbase is 0x%x\n", pmbase); 79 pr_debug("pmbase is 0x%x\n", pmbase);
84 return 0; 80 return 0;
85} 81}
86 82
@@ -106,13 +102,13 @@ static void speedstep_set_state(unsigned int state)
106 /* read state */ 102 /* read state */
107 value = inb(pmbase + 0x50); 103 value = inb(pmbase + 0x50);
108 104
109 dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); 105 pr_debug("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value);
110 106
111 /* write new state */ 107 /* write new state */
112 value &= 0xFE; 108 value &= 0xFE;
113 value |= state; 109 value |= state;
114 110
115 dprintk("writing 0x%x to pmbase 0x%x + 0x50\n", value, pmbase); 111 pr_debug("writing 0x%x to pmbase 0x%x + 0x50\n", value, pmbase);
116 112
117 /* Disable bus master arbitration */ 113 /* Disable bus master arbitration */
118 pm2_blk = inb(pmbase + 0x20); 114 pm2_blk = inb(pmbase + 0x20);
@@ -132,10 +128,10 @@ static void speedstep_set_state(unsigned int state)
132 /* Enable IRQs */ 128 /* Enable IRQs */
133 local_irq_restore(flags); 129 local_irq_restore(flags);
134 130
135 dprintk("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); 131 pr_debug("read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value);
136 132
137 if (state == (value & 0x1)) 133 if (state == (value & 0x1))
138 dprintk("change to %u MHz succeeded\n", 134 pr_debug("change to %u MHz succeeded\n",
139 speedstep_get_frequency(speedstep_processor) / 1000); 135 speedstep_get_frequency(speedstep_processor) / 1000);
140 else 136 else
141 printk(KERN_ERR "cpufreq: change failed - I/O error\n"); 137 printk(KERN_ERR "cpufreq: change failed - I/O error\n");
@@ -165,7 +161,7 @@ static int speedstep_activate(void)
165 pci_read_config_word(speedstep_chipset_dev, 0x00A0, &value); 161 pci_read_config_word(speedstep_chipset_dev, 0x00A0, &value);
166 if (!(value & 0x08)) { 162 if (!(value & 0x08)) {
167 value |= 0x08; 163 value |= 0x08;
168 dprintk("activating SpeedStep (TM) registers\n"); 164 pr_debug("activating SpeedStep (TM) registers\n");
169 pci_write_config_word(speedstep_chipset_dev, 0x00A0, value); 165 pci_write_config_word(speedstep_chipset_dev, 0x00A0, value);
170 } 166 }
171 167
@@ -218,7 +214,7 @@ static unsigned int speedstep_detect_chipset(void)
218 return 2; /* 2-M */ 214 return 2; /* 2-M */
219 215
220 if (hostbridge->revision < 5) { 216 if (hostbridge->revision < 5) {
221 dprintk("hostbridge does not support speedstep\n"); 217 pr_debug("hostbridge does not support speedstep\n");
222 speedstep_chipset_dev = NULL; 218 speedstep_chipset_dev = NULL;
223 pci_dev_put(hostbridge); 219 pci_dev_put(hostbridge);
224 return 0; 220 return 0;
@@ -246,7 +242,7 @@ static unsigned int speedstep_get(unsigned int cpu)
246 if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0) 242 if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
247 BUG(); 243 BUG();
248 244
249 dprintk("detected %u kHz as current frequency\n", speed); 245 pr_debug("detected %u kHz as current frequency\n", speed);
250 return speed; 246 return speed;
251} 247}
252 248
@@ -276,7 +272,7 @@ static int speedstep_target(struct cpufreq_policy *policy,
276 freqs.new = speedstep_freqs[newstate].frequency; 272 freqs.new = speedstep_freqs[newstate].frequency;
277 freqs.cpu = policy->cpu; 273 freqs.cpu = policy->cpu;
278 274
279 dprintk("transiting from %u to %u kHz\n", freqs.old, freqs.new); 275 pr_debug("transiting from %u to %u kHz\n", freqs.old, freqs.new);
280 276
281 /* no transition necessary */ 277 /* no transition necessary */
282 if (freqs.old == freqs.new) 278 if (freqs.old == freqs.new)
@@ -351,7 +347,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
351 if (!speed) 347 if (!speed)
352 return -EIO; 348 return -EIO;
353 349
354 dprintk("currently at %s speed setting - %i MHz\n", 350 pr_debug("currently at %s speed setting - %i MHz\n",
355 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) 351 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
356 ? "low" : "high", 352 ? "low" : "high",
357 (speed / 1000)); 353 (speed / 1000));
@@ -405,14 +401,14 @@ static int __init speedstep_init(void)
405 /* detect processor */ 401 /* detect processor */
406 speedstep_processor = speedstep_detect_processor(); 402 speedstep_processor = speedstep_detect_processor();
407 if (!speedstep_processor) { 403 if (!speedstep_processor) {
408 dprintk("Intel(R) SpeedStep(TM) capable processor " 404 pr_debug("Intel(R) SpeedStep(TM) capable processor "
409 "not found\n"); 405 "not found\n");
410 return -ENODEV; 406 return -ENODEV;
411 } 407 }
412 408
413 /* detect chipset */ 409 /* detect chipset */
414 if (!speedstep_detect_chipset()) { 410 if (!speedstep_detect_chipset()) {
415 dprintk("Intel(R) SpeedStep(TM) for this chipset not " 411 pr_debug("Intel(R) SpeedStep(TM) for this chipset not "
416 "(yet) available.\n"); 412 "(yet) available.\n");
417 return -ENODEV; 413 return -ENODEV;
418 } 414 }
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index a94ec6be69fa..8af2d2fd9d51 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
@@ -18,9 +18,6 @@
18#include <asm/tsc.h> 18#include <asm/tsc.h>
19#include "speedstep-lib.h" 19#include "speedstep-lib.h"
20 20
21#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
22 "speedstep-lib", msg)
23
24#define PFX "speedstep-lib: " 21#define PFX "speedstep-lib: "
25 22
26#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK 23#ifdef CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK
@@ -75,7 +72,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
75 72
76 /* read MSR 0x2a - we only need the low 32 bits */ 73 /* read MSR 0x2a - we only need the low 32 bits */
77 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); 74 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
78 dprintk("P3 - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); 75 pr_debug("P3 - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp);
79 msr_tmp = msr_lo; 76 msr_tmp = msr_lo;
80 77
81 /* decode the FSB */ 78 /* decode the FSB */
@@ -89,7 +86,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
89 86
90 /* decode the multiplier */ 87 /* decode the multiplier */
91 if (processor == SPEEDSTEP_CPU_PIII_C_EARLY) { 88 if (processor == SPEEDSTEP_CPU_PIII_C_EARLY) {
92 dprintk("workaround for early PIIIs\n"); 89 pr_debug("workaround for early PIIIs\n");
93 msr_lo &= 0x03c00000; 90 msr_lo &= 0x03c00000;
94 } else 91 } else
95 msr_lo &= 0x0bc00000; 92 msr_lo &= 0x0bc00000;
@@ -100,7 +97,7 @@ static unsigned int pentium3_get_frequency(enum speedstep_processor processor)
100 j++; 97 j++;
101 } 98 }
102 99
103 dprintk("speed is %u\n", 100 pr_debug("speed is %u\n",
104 (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100)); 101 (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100));
105 102
106 return msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100; 103 return msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100;
@@ -112,7 +109,7 @@ static unsigned int pentiumM_get_frequency(void)
112 u32 msr_lo, msr_tmp; 109 u32 msr_lo, msr_tmp;
113 110
114 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); 111 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
115 dprintk("PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); 112 pr_debug("PM - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp);
116 113
117 /* see table B-2 of 24547212.pdf */ 114 /* see table B-2 of 24547212.pdf */
118 if (msr_lo & 0x00040000) { 115 if (msr_lo & 0x00040000) {
@@ -122,7 +119,7 @@ static unsigned int pentiumM_get_frequency(void)
122 } 119 }
123 120
124 msr_tmp = (msr_lo >> 22) & 0x1f; 121 msr_tmp = (msr_lo >> 22) & 0x1f;
125 dprintk("bits 22-26 are 0x%x, speed is %u\n", 122 pr_debug("bits 22-26 are 0x%x, speed is %u\n",
126 msr_tmp, (msr_tmp * 100 * 1000)); 123 msr_tmp, (msr_tmp * 100 * 1000));
127 124
128 return msr_tmp * 100 * 1000; 125 return msr_tmp * 100 * 1000;
@@ -160,11 +157,11 @@ static unsigned int pentium_core_get_frequency(void)
160 } 157 }
161 158
162 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); 159 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp);
163 dprintk("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", 160 pr_debug("PCORE - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n",
164 msr_lo, msr_tmp); 161 msr_lo, msr_tmp);
165 162
166 msr_tmp = (msr_lo >> 22) & 0x1f; 163 msr_tmp = (msr_lo >> 22) & 0x1f;
167 dprintk("bits 22-26 are 0x%x, speed is %u\n", 164 pr_debug("bits 22-26 are 0x%x, speed is %u\n",
168 msr_tmp, (msr_tmp * fsb)); 165 msr_tmp, (msr_tmp * fsb));
169 166
170 ret = (msr_tmp * fsb); 167 ret = (msr_tmp * fsb);
@@ -190,7 +187,7 @@ static unsigned int pentium4_get_frequency(void)
190 187
191 rdmsr(0x2c, msr_lo, msr_hi); 188 rdmsr(0x2c, msr_lo, msr_hi);
192 189
193 dprintk("P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); 190 pr_debug("P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi);
194 191
195 /* decode the FSB: see IA-32 Intel (C) Architecture Software 192 /* decode the FSB: see IA-32 Intel (C) Architecture Software
196 * Developer's Manual, Volume 3: System Prgramming Guide, 193 * Developer's Manual, Volume 3: System Prgramming Guide,
@@ -217,7 +214,7 @@ static unsigned int pentium4_get_frequency(void)
217 /* Multiplier. */ 214 /* Multiplier. */
218 mult = msr_lo >> 24; 215 mult = msr_lo >> 24;
219 216
220 dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n", 217 pr_debug("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n",
221 fsb, mult, (fsb * mult)); 218 fsb, mult, (fsb * mult));
222 219
223 ret = (fsb * mult); 220 ret = (fsb * mult);
@@ -257,7 +254,7 @@ unsigned int speedstep_detect_processor(void)
257 struct cpuinfo_x86 *c = &cpu_data(0); 254 struct cpuinfo_x86 *c = &cpu_data(0);
258 u32 ebx, msr_lo, msr_hi; 255 u32 ebx, msr_lo, msr_hi;
259 256
260 dprintk("x86: %x, model: %x\n", c->x86, c->x86_model); 257 pr_debug("x86: %x, model: %x\n", c->x86, c->x86_model);
261 258
262 if ((c->x86_vendor != X86_VENDOR_INTEL) || 259 if ((c->x86_vendor != X86_VENDOR_INTEL) ||
263 ((c->x86 != 6) && (c->x86 != 0xF))) 260 ((c->x86 != 6) && (c->x86 != 0xF)))
@@ -272,7 +269,7 @@ unsigned int speedstep_detect_processor(void)
272 ebx = cpuid_ebx(0x00000001); 269 ebx = cpuid_ebx(0x00000001);
273 ebx &= 0x000000FF; 270 ebx &= 0x000000FF;
274 271
275 dprintk("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask); 272 pr_debug("ebx value is %x, x86_mask is %x\n", ebx, c->x86_mask);
276 273
277 switch (c->x86_mask) { 274 switch (c->x86_mask) {
278 case 4: 275 case 4:
@@ -327,7 +324,7 @@ unsigned int speedstep_detect_processor(void)
327 /* cpuid_ebx(1) is 0x04 for desktop PIII, 324 /* cpuid_ebx(1) is 0x04 for desktop PIII,
328 * 0x06 for mobile PIII-M */ 325 * 0x06 for mobile PIII-M */
329 ebx = cpuid_ebx(0x00000001); 326 ebx = cpuid_ebx(0x00000001);
330 dprintk("ebx is %x\n", ebx); 327 pr_debug("ebx is %x\n", ebx);
331 328
332 ebx &= 0x000000FF; 329 ebx &= 0x000000FF;
333 330
@@ -344,7 +341,7 @@ unsigned int speedstep_detect_processor(void)
344 /* all mobile PIII Coppermines have FSB 100 MHz 341 /* all mobile PIII Coppermines have FSB 100 MHz
345 * ==> sort out a few desktop PIIIs. */ 342 * ==> sort out a few desktop PIIIs. */
346 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi); 343 rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi);
347 dprintk("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n", 344 pr_debug("Coppermine: MSR_IA32_EBL_CR_POWERON is 0x%x, 0x%x\n",
348 msr_lo, msr_hi); 345 msr_lo, msr_hi);
349 msr_lo &= 0x00c0000; 346 msr_lo &= 0x00c0000;
350 if (msr_lo != 0x0080000) 347 if (msr_lo != 0x0080000)
@@ -357,12 +354,12 @@ unsigned int speedstep_detect_processor(void)
357 * bit 56 or 57 is set 354 * bit 56 or 57 is set
358 */ 355 */
359 rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi); 356 rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi);
360 dprintk("Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", 357 pr_debug("Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n",
361 msr_lo, msr_hi); 358 msr_lo, msr_hi);
362 if ((msr_hi & (1<<18)) && 359 if ((msr_hi & (1<<18)) &&
363 (relaxed_check ? 1 : (msr_hi & (3<<24)))) { 360 (relaxed_check ? 1 : (msr_hi & (3<<24)))) {
364 if (c->x86_mask == 0x01) { 361 if (c->x86_mask == 0x01) {
365 dprintk("early PIII version\n"); 362 pr_debug("early PIII version\n");
366 return SPEEDSTEP_CPU_PIII_C_EARLY; 363 return SPEEDSTEP_CPU_PIII_C_EARLY;
367 } else 364 } else
368 return SPEEDSTEP_CPU_PIII_C; 365 return SPEEDSTEP_CPU_PIII_C;
@@ -393,14 +390,14 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
393 if ((!processor) || (!low_speed) || (!high_speed) || (!set_state)) 390 if ((!processor) || (!low_speed) || (!high_speed) || (!set_state))
394 return -EINVAL; 391 return -EINVAL;
395 392
396 dprintk("trying to determine both speeds\n"); 393 pr_debug("trying to determine both speeds\n");
397 394
398 /* get current speed */ 395 /* get current speed */
399 prev_speed = speedstep_get_frequency(processor); 396 prev_speed = speedstep_get_frequency(processor);
400 if (!prev_speed) 397 if (!prev_speed)
401 return -EIO; 398 return -EIO;
402 399
403 dprintk("previous speed is %u\n", prev_speed); 400 pr_debug("previous speed is %u\n", prev_speed);
404 401
405 local_irq_save(flags); 402 local_irq_save(flags);
406 403
@@ -412,7 +409,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
412 goto out; 409 goto out;
413 } 410 }
414 411
415 dprintk("low speed is %u\n", *low_speed); 412 pr_debug("low speed is %u\n", *low_speed);
416 413
417 /* start latency measurement */ 414 /* start latency measurement */
418 if (transition_latency) 415 if (transition_latency)
@@ -431,7 +428,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
431 goto out; 428 goto out;
432 } 429 }
433 430
434 dprintk("high speed is %u\n", *high_speed); 431 pr_debug("high speed is %u\n", *high_speed);
435 432
436 if (*low_speed == *high_speed) { 433 if (*low_speed == *high_speed) {
437 ret = -ENODEV; 434 ret = -ENODEV;
@@ -445,7 +442,7 @@ unsigned int speedstep_get_freqs(enum speedstep_processor processor,
445 if (transition_latency) { 442 if (transition_latency) {
446 *transition_latency = (tv2.tv_sec - tv1.tv_sec) * USEC_PER_SEC + 443 *transition_latency = (tv2.tv_sec - tv1.tv_sec) * USEC_PER_SEC +
447 tv2.tv_usec - tv1.tv_usec; 444 tv2.tv_usec - tv1.tv_usec;
448 dprintk("transition latency is %u uSec\n", *transition_latency); 445 pr_debug("transition latency is %u uSec\n", *transition_latency);
449 446
450 /* convert uSec to nSec and add 20% for safety reasons */ 447 /* convert uSec to nSec and add 20% for safety reasons */
451 *transition_latency *= 1200; 448 *transition_latency *= 1200;
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
index 91bc25b67bc1..c76ead3490bf 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
@@ -55,9 +55,6 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
55 * of DMA activity going on? */ 55 * of DMA activity going on? */
56#define SMI_TRIES 5 56#define SMI_TRIES 5
57 57
58#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \
59 "speedstep-smi", msg)
60
61/** 58/**
62 * speedstep_smi_ownership 59 * speedstep_smi_ownership
63 */ 60 */
@@ -70,7 +67,7 @@ static int speedstep_smi_ownership(void)
70 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 67 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
71 magic = virt_to_phys(magic_data); 68 magic = virt_to_phys(magic_data);
72 69
73 dprintk("trying to obtain ownership with command %x at port %x\n", 70 pr_debug("trying to obtain ownership with command %x at port %x\n",
74 command, smi_port); 71 command, smi_port);
75 72
76 __asm__ __volatile__( 73 __asm__ __volatile__(
@@ -85,7 +82,7 @@ static int speedstep_smi_ownership(void)
85 : "memory" 82 : "memory"
86 ); 83 );
87 84
88 dprintk("result is %x\n", result); 85 pr_debug("result is %x\n", result);
89 86
90 return result; 87 return result;
91} 88}
@@ -106,13 +103,13 @@ static int speedstep_smi_get_freqs(unsigned int *low, unsigned int *high)
106 u32 function = GET_SPEEDSTEP_FREQS; 103 u32 function = GET_SPEEDSTEP_FREQS;
107 104
108 if (!(ist_info.event & 0xFFFF)) { 105 if (!(ist_info.event & 0xFFFF)) {
109 dprintk("bug #1422 -- can't read freqs from BIOS\n"); 106 pr_debug("bug #1422 -- can't read freqs from BIOS\n");
110 return -ENODEV; 107 return -ENODEV;
111 } 108 }
112 109
113 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 110 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
114 111
115 dprintk("trying to determine frequencies with command %x at port %x\n", 112 pr_debug("trying to determine frequencies with command %x at port %x\n",
116 command, smi_port); 113 command, smi_port);
117 114
118 __asm__ __volatile__( 115 __asm__ __volatile__(
@@ -129,7 +126,7 @@ static int speedstep_smi_get_freqs(unsigned int *low, unsigned int *high)
129 "d" (smi_port), "S" (0), "D" (0) 126 "d" (smi_port), "S" (0), "D" (0)
130 ); 127 );
131 128
132 dprintk("result %x, low_freq %u, high_freq %u\n", 129 pr_debug("result %x, low_freq %u, high_freq %u\n",
133 result, low_mhz, high_mhz); 130 result, low_mhz, high_mhz);
134 131
135 /* abort if results are obviously incorrect... */ 132 /* abort if results are obviously incorrect... */
@@ -154,7 +151,7 @@ static int speedstep_get_state(void)
154 151
155 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 152 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
156 153
157 dprintk("trying to determine current setting with command %x " 154 pr_debug("trying to determine current setting with command %x "
158 "at port %x\n", command, smi_port); 155 "at port %x\n", command, smi_port);
159 156
160 __asm__ __volatile__( 157 __asm__ __volatile__(
@@ -168,7 +165,7 @@ static int speedstep_get_state(void)
168 "d" (smi_port), "S" (0), "D" (0) 165 "d" (smi_port), "S" (0), "D" (0)
169 ); 166 );
170 167
171 dprintk("state is %x, result is %x\n", state, result); 168 pr_debug("state is %x, result is %x\n", state, result);
172 169
173 return state & 1; 170 return state & 1;
174} 171}
@@ -194,13 +191,13 @@ static void speedstep_set_state(unsigned int state)
194 191
195 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff); 192 command = (smi_sig & 0xffffff00) | (smi_cmd & 0xff);
196 193
197 dprintk("trying to set frequency to state %u " 194 pr_debug("trying to set frequency to state %u "
198 "with command %x at port %x\n", 195 "with command %x at port %x\n",
199 state, command, smi_port); 196 state, command, smi_port);
200 197
201 do { 198 do {
202 if (retry) { 199 if (retry) {
203 dprintk("retry %u, previous result %u, waiting...\n", 200 pr_debug("retry %u, previous result %u, waiting...\n",
204 retry, result); 201 retry, result);
205 mdelay(retry * 50); 202 mdelay(retry * 50);
206 } 203 }
@@ -221,7 +218,7 @@ static void speedstep_set_state(unsigned int state)
221 local_irq_restore(flags); 218 local_irq_restore(flags);
222 219
223 if (new_state == state) 220 if (new_state == state)
224 dprintk("change to %u MHz succeeded after %u tries " 221 pr_debug("change to %u MHz succeeded after %u tries "
225 "with result %u\n", 222 "with result %u\n",
226 (speedstep_freqs[new_state].frequency / 1000), 223 (speedstep_freqs[new_state].frequency / 1000),
227 retry, result); 224 retry, result);
@@ -292,7 +289,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
292 289
293 result = speedstep_smi_ownership(); 290 result = speedstep_smi_ownership();
294 if (result) { 291 if (result) {
295 dprintk("fails in acquiring ownership of a SMI interface.\n"); 292 pr_debug("fails in acquiring ownership of a SMI interface.\n");
296 return -EINVAL; 293 return -EINVAL;
297 } 294 }
298 295
@@ -304,7 +301,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
304 if (result) { 301 if (result) {
305 /* fall back to speedstep_lib.c dection mechanism: 302 /* fall back to speedstep_lib.c dection mechanism:
306 * try both states out */ 303 * try both states out */
307 dprintk("could not detect low and high frequencies " 304 pr_debug("could not detect low and high frequencies "
308 "by SMI call.\n"); 305 "by SMI call.\n");
309 result = speedstep_get_freqs(speedstep_processor, 306 result = speedstep_get_freqs(speedstep_processor,
310 low, high, 307 low, high,
@@ -312,18 +309,18 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
312 &speedstep_set_state); 309 &speedstep_set_state);
313 310
314 if (result) { 311 if (result) {
315 dprintk("could not detect two different speeds" 312 pr_debug("could not detect two different speeds"
316 " -- aborting.\n"); 313 " -- aborting.\n");
317 return result; 314 return result;
318 } else 315 } else
319 dprintk("workaround worked.\n"); 316 pr_debug("workaround worked.\n");
320 } 317 }
321 318
322 /* get current speed setting */ 319 /* get current speed setting */
323 state = speedstep_get_state(); 320 state = speedstep_get_state();
324 speed = speedstep_freqs[state].frequency; 321 speed = speedstep_freqs[state].frequency;
325 322
326 dprintk("currently at %s speed setting - %i MHz\n", 323 pr_debug("currently at %s speed setting - %i MHz\n",
327 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency) 324 (speed == speedstep_freqs[SPEEDSTEP_LOW].frequency)
328 ? "low" : "high", 325 ? "low" : "high",
329 (speed / 1000)); 326 (speed / 1000));
@@ -360,7 +357,7 @@ static int speedstep_resume(struct cpufreq_policy *policy)
360 int result = speedstep_smi_ownership(); 357 int result = speedstep_smi_ownership();
361 358
362 if (result) 359 if (result)
363 dprintk("fails in re-acquiring ownership of a SMI interface.\n"); 360 pr_debug("fails in re-acquiring ownership of a SMI interface.\n");
364 361
365 return result; 362 return result;
366} 363}
@@ -403,12 +400,12 @@ static int __init speedstep_init(void)
403 } 400 }
404 401
405 if (!speedstep_processor) { 402 if (!speedstep_processor) {
406 dprintk("No supported Intel CPU detected.\n"); 403 pr_debug("No supported Intel CPU detected.\n");
407 return -ENODEV; 404 return -ENODEV;
408 } 405 }
409 406
410 dprintk("signature:0x%.8lx, command:0x%.8lx, " 407 pr_debug("signature:0x%.8ulx, command:0x%.8ulx, "
411 "event:0x%.8lx, perf_level:0x%.8lx.\n", 408 "event:0x%.8ulx, perf_level:0x%.8ulx.\n",
412 ist_info.signature, ist_info.command, 409 ist_info.signature, ist_info.command,
413 ist_info.event, ist_info.perf_level); 410 ist_info.event, ist_info.perf_level);
414 411
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 3a73a93596e8..85b32376dad7 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -49,10 +49,6 @@ ACPI_MODULE_NAME("processor_perflib");
49 49
50static DEFINE_MUTEX(performance_mutex); 50static DEFINE_MUTEX(performance_mutex);
51 51
52/* Use cpufreq debug layer for _PPC changes. */
53#define cpufreq_printk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \
54 "cpufreq-core", msg)
55
56/* 52/*
57 * _PPC support is implemented as a CPUfreq policy notifier: 53 * _PPC support is implemented as a CPUfreq policy notifier:
58 * This means each time a CPUfreq driver registered also with 54 * 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 return -ENODEV; 141 return -ENODEV;
146 } 142 }
147 143
148 cpufreq_printk("CPU %d: _PPC is %d - frequency %s limited\n", pr->id, 144 pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id,
149 (int)ppc, ppc ? "" : "not"); 145 (int)ppc, ppc ? "" : "not");
150 146
151 pr->performance_platform_limit = (int)ppc; 147 pr->performance_platform_limit = (int)ppc;
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index ca8ee8093d6c..b78baa547ef5 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -18,19 +18,6 @@ if CPU_FREQ
18config CPU_FREQ_TABLE 18config CPU_FREQ_TABLE
19 tristate 19 tristate
20 20
21config CPU_FREQ_DEBUG
22 bool "Enable CPUfreq debugging"
23 help
24 Say Y here to enable CPUfreq subsystem (including drivers)
25 debugging. You will need to activate it via the kernel
26 command line by passing
27 cpufreq.debug=<value>
28
29 To get <value>, add
30 1 to activate CPUfreq core debugging,
31 2 to activate CPUfreq drivers debugging, and
32 4 to activate CPUfreq governor debugging
33
34config CPU_FREQ_STAT 21config CPU_FREQ_STAT
35 tristate "CPU frequency translation statistics" 22 tristate "CPU frequency translation statistics"
36 select CPU_FREQ_TABLE 23 select CPU_FREQ_TABLE
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 7c10f96c5ae9..1e08af43ae72 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -32,9 +32,6 @@
32 32
33#include <trace/events/power.h> 33#include <trace/events/power.h>
34 34
35#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \
36 "cpufreq-core", msg)
37
38/** 35/**
39 * The "cpufreq driver" - the arch- or hardware-dependent low 36 * The "cpufreq driver" - the arch- or hardware-dependent low
40 * level driver of CPUFreq support, and its spinlock. This lock 37 * level driver of CPUFreq support, and its spinlock. This lock
@@ -181,93 +178,6 @@ EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
181 178
182 179
183/********************************************************************* 180/*********************************************************************
184 * UNIFIED DEBUG HELPERS *
185 *********************************************************************/
186#ifdef CONFIG_CPU_FREQ_DEBUG
187
188/* what part(s) of the CPUfreq subsystem are debugged? */
189static unsigned int debug;
190
191/* is the debug output ratelimit'ed using printk_ratelimit? User can
192 * set or modify this value.
193 */
194static unsigned int debug_ratelimit = 1;
195
196/* is the printk_ratelimit'ing enabled? It's enabled after a successful
197 * loading of a cpufreq driver, temporarily disabled when a new policy
198 * is set, and disabled upon cpufreq driver removal
199 */
200static unsigned int disable_ratelimit = 1;
201static DEFINE_SPINLOCK(disable_ratelimit_lock);
202
203static void cpufreq_debug_enable_ratelimit(void)
204{
205 unsigned long flags;
206
207 spin_lock_irqsave(&disable_ratelimit_lock, flags);
208 if (disable_ratelimit)
209 disable_ratelimit--;
210 spin_unlock_irqrestore(&disable_ratelimit_lock, flags);
211}
212
213static void cpufreq_debug_disable_ratelimit(void)
214{
215 unsigned long flags;
216
217 spin_lock_irqsave(&disable_ratelimit_lock, flags);
218 disable_ratelimit++;
219 spin_unlock_irqrestore(&disable_ratelimit_lock, flags);
220}
221
222void cpufreq_debug_printk(unsigned int type, const char *prefix,
223 const char *fmt, ...)
224{
225 char s[256];
226 va_list args;
227 unsigned int len;
228 unsigned long flags;
229
230 WARN_ON(!prefix);
231 if (type & debug) {
232 spin_lock_irqsave(&disable_ratelimit_lock, flags);
233 if (!disable_ratelimit && debug_ratelimit
234 && !printk_ratelimit()) {
235 spin_unlock_irqrestore(&disable_ratelimit_lock, flags);
236 return;
237 }
238 spin_unlock_irqrestore(&disable_ratelimit_lock, flags);
239
240 len = snprintf(s, 256, KERN_DEBUG "%s: ", prefix);
241
242 va_start(args, fmt);
243 len += vsnprintf(&s[len], (256 - len), fmt, args);
244 va_end(args);
245
246 printk(s);
247
248 WARN_ON(len < 5);
249 }
250}
251EXPORT_SYMBOL(cpufreq_debug_printk);
252
253
254module_param(debug, uint, 0644);
255MODULE_PARM_DESC(debug, "CPUfreq debugging: add 1 to debug core,"
256 " 2 to debug drivers, and 4 to debug governors.");
257
258module_param(debug_ratelimit, uint, 0644);
259MODULE_PARM_DESC(debug_ratelimit, "CPUfreq debugging:"
260 " set to 0 to disable ratelimiting.");
261
262#else /* !CONFIG_CPU_FREQ_DEBUG */
263
264static inline void cpufreq_debug_enable_ratelimit(void) { return; }
265static inline void cpufreq_debug_disable_ratelimit(void) { return; }
266
267#endif /* CONFIG_CPU_FREQ_DEBUG */
268
269
270/*********************************************************************
271 * EXTERNALLY AFFECTING FREQUENCY CHANGES * 181 * EXTERNALLY AFFECTING FREQUENCY CHANGES *
272 *********************************************************************/ 182 *********************************************************************/
273 183
@@ -291,7 +201,7 @@ static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
291 if (!l_p_j_ref_freq) { 201 if (!l_p_j_ref_freq) {
292 l_p_j_ref = loops_per_jiffy; 202 l_p_j_ref = loops_per_jiffy;
293 l_p_j_ref_freq = ci->old; 203 l_p_j_ref_freq = ci->old;
294 dprintk("saving %lu as reference value for loops_per_jiffy; " 204 pr_debug("saving %lu as reference value for loops_per_jiffy; "
295 "freq is %u kHz\n", l_p_j_ref, l_p_j_ref_freq); 205 "freq is %u kHz\n", l_p_j_ref, l_p_j_ref_freq);
296 } 206 }
297 if ((val == CPUFREQ_PRECHANGE && ci->old < ci->new) || 207 if ((val == CPUFREQ_PRECHANGE && ci->old < ci->new) ||
@@ -299,7 +209,7 @@ static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
299 (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) { 209 (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
300 loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq, 210 loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq,
301 ci->new); 211 ci->new);
302 dprintk("scaling loops_per_jiffy to %lu " 212 pr_debug("scaling loops_per_jiffy to %lu "
303 "for frequency %u kHz\n", loops_per_jiffy, ci->new); 213 "for frequency %u kHz\n", loops_per_jiffy, ci->new);
304 } 214 }
305} 215}
@@ -326,7 +236,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
326 BUG_ON(irqs_disabled()); 236 BUG_ON(irqs_disabled());
327 237
328 freqs->flags = cpufreq_driver->flags; 238 freqs->flags = cpufreq_driver->flags;
329 dprintk("notification %u of frequency transition to %u kHz\n", 239 pr_debug("notification %u of frequency transition to %u kHz\n",
330 state, freqs->new); 240 state, freqs->new);
331 241
332 policy = per_cpu(cpufreq_cpu_data, freqs->cpu); 242 policy = per_cpu(cpufreq_cpu_data, freqs->cpu);
@@ -340,7 +250,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
340 if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) { 250 if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
341 if ((policy) && (policy->cpu == freqs->cpu) && 251 if ((policy) && (policy->cpu == freqs->cpu) &&
342 (policy->cur) && (policy->cur != freqs->old)) { 252 (policy->cur) && (policy->cur != freqs->old)) {
343 dprintk("Warning: CPU frequency is" 253 pr_debug("Warning: CPU frequency is"
344 " %u, cpufreq assumed %u kHz.\n", 254 " %u, cpufreq assumed %u kHz.\n",
345 freqs->old, policy->cur); 255 freqs->old, policy->cur);
346 freqs->old = policy->cur; 256 freqs->old = policy->cur;
@@ -353,7 +263,7 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
353 263
354 case CPUFREQ_POSTCHANGE: 264 case CPUFREQ_POSTCHANGE:
355 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); 265 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
356 dprintk("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, 266 pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new,
357 (unsigned long)freqs->cpu); 267 (unsigned long)freqs->cpu);
358 trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu); 268 trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu);
359 trace_cpu_frequency(freqs->new, freqs->cpu); 269 trace_cpu_frequency(freqs->new, freqs->cpu);
@@ -753,7 +663,7 @@ no_policy:
753static void cpufreq_sysfs_release(struct kobject *kobj) 663static void cpufreq_sysfs_release(struct kobject *kobj)
754{ 664{
755 struct cpufreq_policy *policy = to_policy(kobj); 665 struct cpufreq_policy *policy = to_policy(kobj);
756 dprintk("last reference is dropped\n"); 666 pr_debug("last reference is dropped\n");
757 complete(&policy->kobj_unregister); 667 complete(&policy->kobj_unregister);
758} 668}
759 669
@@ -788,7 +698,7 @@ static int cpufreq_add_dev_policy(unsigned int cpu,
788 gov = __find_governor(per_cpu(cpufreq_cpu_governor, cpu)); 698 gov = __find_governor(per_cpu(cpufreq_cpu_governor, cpu));
789 if (gov) { 699 if (gov) {
790 policy->governor = gov; 700 policy->governor = gov;
791 dprintk("Restoring governor %s for cpu %d\n", 701 pr_debug("Restoring governor %s for cpu %d\n",
792 policy->governor->name, cpu); 702 policy->governor->name, cpu);
793 } 703 }
794#endif 704#endif
@@ -824,7 +734,7 @@ static int cpufreq_add_dev_policy(unsigned int cpu,
824 per_cpu(cpufreq_cpu_data, cpu) = managed_policy; 734 per_cpu(cpufreq_cpu_data, cpu) = managed_policy;
825 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 735 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
826 736
827 dprintk("CPU already managed, adding link\n"); 737 pr_debug("CPU already managed, adding link\n");
828 ret = sysfs_create_link(&sys_dev->kobj, 738 ret = sysfs_create_link(&sys_dev->kobj,
829 &managed_policy->kobj, 739 &managed_policy->kobj,
830 "cpufreq"); 740 "cpufreq");
@@ -865,7 +775,7 @@ static int cpufreq_add_dev_symlink(unsigned int cpu,
865 if (!cpu_online(j)) 775 if (!cpu_online(j))
866 continue; 776 continue;
867 777
868 dprintk("CPU %u already managed, adding link\n", j); 778 pr_debug("CPU %u already managed, adding link\n", j);
869 managed_policy = cpufreq_cpu_get(cpu); 779 managed_policy = cpufreq_cpu_get(cpu);
870 cpu_sys_dev = get_cpu_sysdev(j); 780 cpu_sys_dev = get_cpu_sysdev(j);
871 ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, 781 ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj,
@@ -941,7 +851,7 @@ static int cpufreq_add_dev_interface(unsigned int cpu,
941 policy->user_policy.governor = policy->governor; 851 policy->user_policy.governor = policy->governor;
942 852
943 if (ret) { 853 if (ret) {
944 dprintk("setting policy failed\n"); 854 pr_debug("setting policy failed\n");
945 if (cpufreq_driver->exit) 855 if (cpufreq_driver->exit)
946 cpufreq_driver->exit(policy); 856 cpufreq_driver->exit(policy);
947 } 857 }
@@ -977,8 +887,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
977 if (cpu_is_offline(cpu)) 887 if (cpu_is_offline(cpu))
978 return 0; 888 return 0;
979 889
980 cpufreq_debug_disable_ratelimit(); 890 pr_debug("adding CPU %u\n", cpu);
981 dprintk("adding CPU %u\n", cpu);
982 891
983#ifdef CONFIG_SMP 892#ifdef CONFIG_SMP
984 /* check whether a different CPU already registered this 893 /* check whether a different CPU already registered this
@@ -986,7 +895,6 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
986 policy = cpufreq_cpu_get(cpu); 895 policy = cpufreq_cpu_get(cpu);
987 if (unlikely(policy)) { 896 if (unlikely(policy)) {
988 cpufreq_cpu_put(policy); 897 cpufreq_cpu_put(policy);
989 cpufreq_debug_enable_ratelimit();
990 return 0; 898 return 0;
991 } 899 }
992#endif 900#endif
@@ -1037,7 +945,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
1037 */ 945 */
1038 ret = cpufreq_driver->init(policy); 946 ret = cpufreq_driver->init(policy);
1039 if (ret) { 947 if (ret) {
1040 dprintk("initialization failed\n"); 948 pr_debug("initialization failed\n");
1041 goto err_unlock_policy; 949 goto err_unlock_policy;
1042 } 950 }
1043 policy->user_policy.min = policy->min; 951 policy->user_policy.min = policy->min;
@@ -1063,8 +971,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
1063 971
1064 kobject_uevent(&policy->kobj, KOBJ_ADD); 972 kobject_uevent(&policy->kobj, KOBJ_ADD);
1065 module_put(cpufreq_driver->owner); 973 module_put(cpufreq_driver->owner);
1066 dprintk("initialization complete\n"); 974 pr_debug("initialization complete\n");
1067 cpufreq_debug_enable_ratelimit();
1068 975
1069 return 0; 976 return 0;
1070 977
@@ -1088,7 +995,6 @@ err_free_policy:
1088nomem_out: 995nomem_out:
1089 module_put(cpufreq_driver->owner); 996 module_put(cpufreq_driver->owner);
1090module_out: 997module_out:
1091 cpufreq_debug_enable_ratelimit();
1092 return ret; 998 return ret;
1093} 999}
1094 1000
@@ -1112,15 +1018,13 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1112 unsigned int j; 1018 unsigned int j;
1113#endif 1019#endif
1114 1020
1115 cpufreq_debug_disable_ratelimit(); 1021 pr_debug("unregistering CPU %u\n", cpu);
1116 dprintk("unregistering CPU %u\n", cpu);
1117 1022
1118 spin_lock_irqsave(&cpufreq_driver_lock, flags); 1023 spin_lock_irqsave(&cpufreq_driver_lock, flags);
1119 data = per_cpu(cpufreq_cpu_data, cpu); 1024 data = per_cpu(cpufreq_cpu_data, cpu);
1120 1025
1121 if (!data) { 1026 if (!data) {
1122 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1027 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
1123 cpufreq_debug_enable_ratelimit();
1124 unlock_policy_rwsem_write(cpu); 1028 unlock_policy_rwsem_write(cpu);
1125 return -EINVAL; 1029 return -EINVAL;
1126 } 1030 }
@@ -1132,12 +1036,11 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1132 * only need to unlink, put and exit 1036 * only need to unlink, put and exit
1133 */ 1037 */
1134 if (unlikely(cpu != data->cpu)) { 1038 if (unlikely(cpu != data->cpu)) {
1135 dprintk("removing link\n"); 1039 pr_debug("removing link\n");
1136 cpumask_clear_cpu(cpu, data->cpus); 1040 cpumask_clear_cpu(cpu, data->cpus);
1137 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 1041 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
1138 kobj = &sys_dev->kobj; 1042 kobj = &sys_dev->kobj;
1139 cpufreq_cpu_put(data); 1043 cpufreq_cpu_put(data);
1140 cpufreq_debug_enable_ratelimit();
1141 unlock_policy_rwsem_write(cpu); 1044 unlock_policy_rwsem_write(cpu);
1142 sysfs_remove_link(kobj, "cpufreq"); 1045 sysfs_remove_link(kobj, "cpufreq");
1143 return 0; 1046 return 0;
@@ -1170,7 +1073,7 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1170 for_each_cpu(j, data->cpus) { 1073 for_each_cpu(j, data->cpus) {
1171 if (j == cpu) 1074 if (j == cpu)
1172 continue; 1075 continue;
1173 dprintk("removing link for cpu %u\n", j); 1076 pr_debug("removing link for cpu %u\n", j);
1174#ifdef CONFIG_HOTPLUG_CPU 1077#ifdef CONFIG_HOTPLUG_CPU
1175 strncpy(per_cpu(cpufreq_cpu_governor, j), 1078 strncpy(per_cpu(cpufreq_cpu_governor, j),
1176 data->governor->name, CPUFREQ_NAME_LEN); 1079 data->governor->name, CPUFREQ_NAME_LEN);
@@ -1199,17 +1102,15 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
1199 * not referenced anymore by anybody before we proceed with 1102 * not referenced anymore by anybody before we proceed with
1200 * unloading. 1103 * unloading.
1201 */ 1104 */
1202 dprintk("waiting for dropping of refcount\n"); 1105 pr_debug("waiting for dropping of refcount\n");
1203 wait_for_completion(cmp); 1106 wait_for_completion(cmp);
1204 dprintk("wait complete\n"); 1107 pr_debug("wait complete\n");
1205 1108
1206 lock_policy_rwsem_write(cpu); 1109 lock_policy_rwsem_write(cpu);
1207 if (cpufreq_driver->exit) 1110 if (cpufreq_driver->exit)
1208 cpufreq_driver->exit(data); 1111 cpufreq_driver->exit(data);
1209 unlock_policy_rwsem_write(cpu); 1112 unlock_policy_rwsem_write(cpu);
1210 1113
1211 cpufreq_debug_enable_ratelimit();
1212
1213#ifdef CONFIG_HOTPLUG_CPU 1114#ifdef CONFIG_HOTPLUG_CPU
1214 /* when the CPU which is the parent of the kobj is hotplugged 1115 /* when the CPU which is the parent of the kobj is hotplugged
1215 * offline, check for siblings, and create cpufreq sysfs interface 1116 * offline, check for siblings, and create cpufreq sysfs interface
@@ -1255,7 +1156,7 @@ static void handle_update(struct work_struct *work)
1255 struct cpufreq_policy *policy = 1156 struct cpufreq_policy *policy =
1256 container_of(work, struct cpufreq_policy, update); 1157 container_of(work, struct cpufreq_policy, update);
1257 unsigned int cpu = policy->cpu; 1158 unsigned int cpu = policy->cpu;
1258 dprintk("handle_update for cpu %u called\n", cpu); 1159 pr_debug("handle_update for cpu %u called\n", cpu);
1259 cpufreq_update_policy(cpu); 1160 cpufreq_update_policy(cpu);
1260} 1161}
1261 1162
@@ -1273,7 +1174,7 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq,
1273{ 1174{
1274 struct cpufreq_freqs freqs; 1175 struct cpufreq_freqs freqs;
1275 1176
1276 dprintk("Warning: CPU frequency out of sync: cpufreq and timing " 1177 pr_debug("Warning: CPU frequency out of sync: cpufreq and timing "
1277 "core thinks of %u, is %u kHz.\n", old_freq, new_freq); 1178 "core thinks of %u, is %u kHz.\n", old_freq, new_freq);
1278 1179
1279 freqs.cpu = cpu; 1180 freqs.cpu = cpu;
@@ -1376,7 +1277,7 @@ static int cpufreq_bp_suspend(void)
1376 int cpu = smp_processor_id(); 1277 int cpu = smp_processor_id();
1377 struct cpufreq_policy *cpu_policy; 1278 struct cpufreq_policy *cpu_policy;
1378 1279
1379 dprintk("suspending cpu %u\n", cpu); 1280 pr_debug("suspending cpu %u\n", cpu);
1380 1281
1381 /* If there's no policy for the boot CPU, we have nothing to do. */ 1282 /* If there's no policy for the boot CPU, we have nothing to do. */
1382 cpu_policy = cpufreq_cpu_get(cpu); 1283 cpu_policy = cpufreq_cpu_get(cpu);
@@ -1414,7 +1315,7 @@ static void cpufreq_bp_resume(void)
1414 int cpu = smp_processor_id(); 1315 int cpu = smp_processor_id();
1415 struct cpufreq_policy *cpu_policy; 1316 struct cpufreq_policy *cpu_policy;
1416 1317
1417 dprintk("resuming cpu %u\n", cpu); 1318 pr_debug("resuming cpu %u\n", cpu);
1418 1319
1419 /* If there's no policy for the boot CPU, we have nothing to do. */ 1320 /* If there's no policy for the boot CPU, we have nothing to do. */
1420 cpu_policy = cpufreq_cpu_get(cpu); 1321 cpu_policy = cpufreq_cpu_get(cpu);
@@ -1526,7 +1427,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
1526{ 1427{
1527 int retval = -EINVAL; 1428 int retval = -EINVAL;
1528 1429
1529 dprintk("target for CPU %u: %u kHz, relation %u\n", policy->cpu, 1430 pr_debug("target for CPU %u: %u kHz, relation %u\n", policy->cpu,
1530 target_freq, relation); 1431 target_freq, relation);
1531 if (cpu_online(policy->cpu) && cpufreq_driver->target) 1432 if (cpu_online(policy->cpu) && cpufreq_driver->target)
1532 retval = cpufreq_driver->target(policy, target_freq, relation); 1433 retval = cpufreq_driver->target(policy, target_freq, relation);
@@ -1612,7 +1513,7 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
1612 if (!try_module_get(policy->governor->owner)) 1513 if (!try_module_get(policy->governor->owner))
1613 return -EINVAL; 1514 return -EINVAL;
1614 1515
1615 dprintk("__cpufreq_governor for CPU %u, event %u\n", 1516 pr_debug("__cpufreq_governor for CPU %u, event %u\n",
1616 policy->cpu, event); 1517 policy->cpu, event);
1617 ret = policy->governor->governor(policy, event); 1518 ret = policy->governor->governor(policy, event);
1618 1519
@@ -1713,8 +1614,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
1713{ 1614{
1714 int ret = 0; 1615 int ret = 0;
1715 1616
1716 cpufreq_debug_disable_ratelimit(); 1617 pr_debug("setting new policy for CPU %u: %u - %u kHz\n", policy->cpu,
1717 dprintk("setting new policy for CPU %u: %u - %u kHz\n", policy->cpu,
1718 policy->min, policy->max); 1618 policy->min, policy->max);
1719 1619
1720 memcpy(&policy->cpuinfo, &data->cpuinfo, 1620 memcpy(&policy->cpuinfo, &data->cpuinfo,
@@ -1751,19 +1651,19 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
1751 data->min = policy->min; 1651 data->min = policy->min;
1752 data->max = policy->max; 1652 data->max = policy->max;
1753 1653
1754 dprintk("new min and max freqs are %u - %u kHz\n", 1654 pr_debug("new min and max freqs are %u - %u kHz\n",
1755 data->min, data->max); 1655 data->min, data->max);
1756 1656
1757 if (cpufreq_driver->setpolicy) { 1657 if (cpufreq_driver->setpolicy) {
1758 data->policy = policy->policy; 1658 data->policy = policy->policy;
1759 dprintk("setting range\n"); 1659 pr_debug("setting range\n");
1760 ret = cpufreq_driver->setpolicy(policy); 1660 ret = cpufreq_driver->setpolicy(policy);
1761 } else { 1661 } else {
1762 if (policy->governor != data->governor) { 1662 if (policy->governor != data->governor) {
1763 /* save old, working values */ 1663 /* save old, working values */
1764 struct cpufreq_governor *old_gov = data->governor; 1664 struct cpufreq_governor *old_gov = data->governor;
1765 1665
1766 dprintk("governor switch\n"); 1666 pr_debug("governor switch\n");
1767 1667
1768 /* end old governor */ 1668 /* end old governor */
1769 if (data->governor) 1669 if (data->governor)
@@ -1773,7 +1673,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
1773 data->governor = policy->governor; 1673 data->governor = policy->governor;
1774 if (__cpufreq_governor(data, CPUFREQ_GOV_START)) { 1674 if (__cpufreq_governor(data, CPUFREQ_GOV_START)) {
1775 /* new governor failed, so re-start old one */ 1675 /* new governor failed, so re-start old one */
1776 dprintk("starting governor %s failed\n", 1676 pr_debug("starting governor %s failed\n",
1777 data->governor->name); 1677 data->governor->name);
1778 if (old_gov) { 1678 if (old_gov) {
1779 data->governor = old_gov; 1679 data->governor = old_gov;
@@ -1785,12 +1685,11 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data,
1785 } 1685 }
1786 /* might be a policy change, too, so fall through */ 1686 /* might be a policy change, too, so fall through */
1787 } 1687 }
1788 dprintk("governor: change or update limits\n"); 1688 pr_debug("governor: change or update limits\n");
1789 __cpufreq_governor(data, CPUFREQ_GOV_LIMITS); 1689 __cpufreq_governor(data, CPUFREQ_GOV_LIMITS);
1790 } 1690 }
1791 1691
1792error_out: 1692error_out:
1793 cpufreq_debug_enable_ratelimit();
1794 return ret; 1693 return ret;
1795} 1694}
1796 1695
@@ -1817,7 +1716,7 @@ int cpufreq_update_policy(unsigned int cpu)
1817 goto fail; 1716 goto fail;
1818 } 1717 }
1819 1718
1820 dprintk("updating policy for CPU %u\n", cpu); 1719 pr_debug("updating policy for CPU %u\n", cpu);
1821 memcpy(&policy, data, sizeof(struct cpufreq_policy)); 1720 memcpy(&policy, data, sizeof(struct cpufreq_policy));
1822 policy.min = data->user_policy.min; 1721 policy.min = data->user_policy.min;
1823 policy.max = data->user_policy.max; 1722 policy.max = data->user_policy.max;
@@ -1829,7 +1728,7 @@ int cpufreq_update_policy(unsigned int cpu)
1829 if (cpufreq_driver->get) { 1728 if (cpufreq_driver->get) {
1830 policy.cur = cpufreq_driver->get(cpu); 1729 policy.cur = cpufreq_driver->get(cpu);
1831 if (!data->cur) { 1730 if (!data->cur) {
1832 dprintk("Driver did not initialize current freq"); 1731 pr_debug("Driver did not initialize current freq");
1833 data->cur = policy.cur; 1732 data->cur = policy.cur;
1834 } else { 1733 } else {
1835 if (data->cur != policy.cur) 1734 if (data->cur != policy.cur)
@@ -1905,7 +1804,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
1905 ((!driver_data->setpolicy) && (!driver_data->target))) 1804 ((!driver_data->setpolicy) && (!driver_data->target)))
1906 return -EINVAL; 1805 return -EINVAL;
1907 1806
1908 dprintk("trying to register driver %s\n", driver_data->name); 1807 pr_debug("trying to register driver %s\n", driver_data->name);
1909 1808
1910 if (driver_data->setpolicy) 1809 if (driver_data->setpolicy)
1911 driver_data->flags |= CPUFREQ_CONST_LOOPS; 1810 driver_data->flags |= CPUFREQ_CONST_LOOPS;
@@ -1936,15 +1835,14 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
1936 1835
1937 /* if all ->init() calls failed, unregister */ 1836 /* if all ->init() calls failed, unregister */
1938 if (ret) { 1837 if (ret) {
1939 dprintk("no CPU initialized for driver %s\n", 1838 pr_debug("no CPU initialized for driver %s\n",
1940 driver_data->name); 1839 driver_data->name);
1941 goto err_sysdev_unreg; 1840 goto err_sysdev_unreg;
1942 } 1841 }
1943 } 1842 }
1944 1843
1945 register_hotcpu_notifier(&cpufreq_cpu_notifier); 1844 register_hotcpu_notifier(&cpufreq_cpu_notifier);
1946 dprintk("driver %s up and running\n", driver_data->name); 1845 pr_debug("driver %s up and running\n", driver_data->name);
1947 cpufreq_debug_enable_ratelimit();
1948 1846
1949 return 0; 1847 return 0;
1950err_sysdev_unreg: 1848err_sysdev_unreg:
@@ -1971,14 +1869,10 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
1971{ 1869{
1972 unsigned long flags; 1870 unsigned long flags;
1973 1871
1974 cpufreq_debug_disable_ratelimit(); 1872 if (!cpufreq_driver || (driver != cpufreq_driver))
1975
1976 if (!cpufreq_driver || (driver != cpufreq_driver)) {
1977 cpufreq_debug_enable_ratelimit();
1978 return -EINVAL; 1873 return -EINVAL;
1979 }
1980 1874
1981 dprintk("unregistering driver %s\n", driver->name); 1875 pr_debug("unregistering driver %s\n", driver->name);
1982 1876
1983 sysdev_driver_unregister(&cpu_sysdev_class, &cpufreq_sysdev_driver); 1877 sysdev_driver_unregister(&cpu_sysdev_class, &cpufreq_sysdev_driver);
1984 unregister_hotcpu_notifier(&cpufreq_cpu_notifier); 1878 unregister_hotcpu_notifier(&cpufreq_cpu_notifier);
diff --git a/drivers/cpufreq/cpufreq_performance.c b/drivers/cpufreq/cpufreq_performance.c
index 7e2e515087f8..f13a8a9af6a1 100644
--- a/drivers/cpufreq/cpufreq_performance.c
+++ b/drivers/cpufreq/cpufreq_performance.c
@@ -15,9 +15,6 @@
15#include <linux/cpufreq.h> 15#include <linux/cpufreq.h>
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#define dprintk(msg...) \
19 cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "performance", msg)
20
21 18
22static int cpufreq_governor_performance(struct cpufreq_policy *policy, 19static int cpufreq_governor_performance(struct cpufreq_policy *policy,
23 unsigned int event) 20 unsigned int event)
@@ -25,7 +22,7 @@ static int cpufreq_governor_performance(struct cpufreq_policy *policy,
25 switch (event) { 22 switch (event) {
26 case CPUFREQ_GOV_START: 23 case CPUFREQ_GOV_START:
27 case CPUFREQ_GOV_LIMITS: 24 case CPUFREQ_GOV_LIMITS:
28 dprintk("setting to %u kHz because of event %u\n", 25 pr_debug("setting to %u kHz because of event %u\n",
29 policy->max, event); 26 policy->max, event);
30 __cpufreq_driver_target(policy, policy->max, 27 __cpufreq_driver_target(policy, policy->max,
31 CPUFREQ_RELATION_H); 28 CPUFREQ_RELATION_H);
diff --git a/drivers/cpufreq/cpufreq_powersave.c b/drivers/cpufreq/cpufreq_powersave.c
index e6db5faf3eb1..4c2eb512f2bc 100644
--- a/drivers/cpufreq/cpufreq_powersave.c
+++ b/drivers/cpufreq/cpufreq_powersave.c
@@ -15,16 +15,13 @@
15#include <linux/cpufreq.h> 15#include <linux/cpufreq.h>
16#include <linux/init.h> 16#include <linux/init.h>
17 17
18#define dprintk(msg...) \
19 cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "powersave", msg)
20
21static int cpufreq_governor_powersave(struct cpufreq_policy *policy, 18static int cpufreq_governor_powersave(struct cpufreq_policy *policy,
22 unsigned int event) 19 unsigned int event)
23{ 20{
24 switch (event) { 21 switch (event) {
25 case CPUFREQ_GOV_START: 22 case CPUFREQ_GOV_START:
26 case CPUFREQ_GOV_LIMITS: 23 case CPUFREQ_GOV_LIMITS:
27 dprintk("setting to %u kHz because of event %u\n", 24 pr_debug("setting to %u kHz because of event %u\n",
28 policy->min, event); 25 policy->min, event);
29 __cpufreq_driver_target(policy, policy->min, 26 __cpufreq_driver_target(policy, policy->min,
30 CPUFREQ_RELATION_L); 27 CPUFREQ_RELATION_L);
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 66d2d1d6c80f..f231015904c0 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -37,9 +37,6 @@ static DEFINE_PER_CPU(unsigned int, cpu_is_managed);
37static DEFINE_MUTEX(userspace_mutex); 37static DEFINE_MUTEX(userspace_mutex);
38static int cpus_using_userspace_governor; 38static int cpus_using_userspace_governor;
39 39
40#define dprintk(msg...) \
41 cpufreq_debug_printk(CPUFREQ_DEBUG_GOVERNOR, "userspace", msg)
42
43/* keep track of frequency transitions */ 40/* keep track of frequency transitions */
44static int 41static int
45userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, 42userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
@@ -50,7 +47,7 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
50 if (!per_cpu(cpu_is_managed, freq->cpu)) 47 if (!per_cpu(cpu_is_managed, freq->cpu))
51 return 0; 48 return 0;
52 49
53 dprintk("saving cpu_cur_freq of cpu %u to be %u kHz\n", 50 pr_debug("saving cpu_cur_freq of cpu %u to be %u kHz\n",
54 freq->cpu, freq->new); 51 freq->cpu, freq->new);
55 per_cpu(cpu_cur_freq, freq->cpu) = freq->new; 52 per_cpu(cpu_cur_freq, freq->cpu) = freq->new;
56 53
@@ -73,7 +70,7 @@ static int cpufreq_set(struct cpufreq_policy *policy, unsigned int freq)
73{ 70{
74 int ret = -EINVAL; 71 int ret = -EINVAL;
75 72
76 dprintk("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq); 73 pr_debug("cpufreq_set for cpu %u, freq %u kHz\n", policy->cpu, freq);
77 74
78 mutex_lock(&userspace_mutex); 75 mutex_lock(&userspace_mutex);
79 if (!per_cpu(cpu_is_managed, policy->cpu)) 76 if (!per_cpu(cpu_is_managed, policy->cpu))
@@ -134,7 +131,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
134 per_cpu(cpu_max_freq, cpu) = policy->max; 131 per_cpu(cpu_max_freq, cpu) = policy->max;
135 per_cpu(cpu_cur_freq, cpu) = policy->cur; 132 per_cpu(cpu_cur_freq, cpu) = policy->cur;
136 per_cpu(cpu_set_freq, cpu) = policy->cur; 133 per_cpu(cpu_set_freq, cpu) = policy->cur;
137 dprintk("managing cpu %u started " 134 pr_debug("managing cpu %u started "
138 "(%u - %u kHz, currently %u kHz)\n", 135 "(%u - %u kHz, currently %u kHz)\n",
139 cpu, 136 cpu,
140 per_cpu(cpu_min_freq, cpu), 137 per_cpu(cpu_min_freq, cpu),
@@ -156,12 +153,12 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
156 per_cpu(cpu_min_freq, cpu) = 0; 153 per_cpu(cpu_min_freq, cpu) = 0;
157 per_cpu(cpu_max_freq, cpu) = 0; 154 per_cpu(cpu_max_freq, cpu) = 0;
158 per_cpu(cpu_set_freq, cpu) = 0; 155 per_cpu(cpu_set_freq, cpu) = 0;
159 dprintk("managing cpu %u stopped\n", cpu); 156 pr_debug("managing cpu %u stopped\n", cpu);
160 mutex_unlock(&userspace_mutex); 157 mutex_unlock(&userspace_mutex);
161 break; 158 break;
162 case CPUFREQ_GOV_LIMITS: 159 case CPUFREQ_GOV_LIMITS:
163 mutex_lock(&userspace_mutex); 160 mutex_lock(&userspace_mutex);
164 dprintk("limit event for cpu %u: %u - %u kHz, " 161 pr_debug("limit event for cpu %u: %u - %u kHz, "
165 "currently %u kHz, last set to %u kHz\n", 162 "currently %u kHz, last set to %u kHz\n",
166 cpu, policy->min, policy->max, 163 cpu, policy->min, policy->max,
167 per_cpu(cpu_cur_freq, cpu), 164 per_cpu(cpu_cur_freq, cpu),
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index 05432216e224..90431cb92804 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -14,9 +14,6 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/cpufreq.h> 15#include <linux/cpufreq.h>
16 16
17#define dprintk(msg...) \
18 cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg)
19
20/********************************************************************* 17/*********************************************************************
21 * FREQUENCY TABLE HELPERS * 18 * FREQUENCY TABLE HELPERS *
22 *********************************************************************/ 19 *********************************************************************/
@@ -31,11 +28,11 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
31 for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) { 28 for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
32 unsigned int freq = table[i].frequency; 29 unsigned int freq = table[i].frequency;
33 if (freq == CPUFREQ_ENTRY_INVALID) { 30 if (freq == CPUFREQ_ENTRY_INVALID) {
34 dprintk("table entry %u is invalid, skipping\n", i); 31 pr_debug("table entry %u is invalid, skipping\n", i);
35 32
36 continue; 33 continue;
37 } 34 }
38 dprintk("table entry %u: %u kHz, %u index\n", 35 pr_debug("table entry %u: %u kHz, %u index\n",
39 i, freq, table[i].index); 36 i, freq, table[i].index);
40 if (freq < min_freq) 37 if (freq < min_freq)
41 min_freq = freq; 38 min_freq = freq;
@@ -61,7 +58,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
61 unsigned int i; 58 unsigned int i;
62 unsigned int count = 0; 59 unsigned int count = 0;
63 60
64 dprintk("request for verification of policy (%u - %u kHz) for cpu %u\n", 61 pr_debug("request for verification of policy (%u - %u kHz) for cpu %u\n",
65 policy->min, policy->max, policy->cpu); 62 policy->min, policy->max, policy->cpu);
66 63
67 if (!cpu_online(policy->cpu)) 64 if (!cpu_online(policy->cpu))
@@ -86,7 +83,7 @@ int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
86 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, 83 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
87 policy->cpuinfo.max_freq); 84 policy->cpuinfo.max_freq);
88 85
89 dprintk("verification lead to (%u - %u kHz) for cpu %u\n", 86 pr_debug("verification lead to (%u - %u kHz) for cpu %u\n",
90 policy->min, policy->max, policy->cpu); 87 policy->min, policy->max, policy->cpu);
91 88
92 return 0; 89 return 0;
@@ -110,7 +107,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
110 }; 107 };
111 unsigned int i; 108 unsigned int i;
112 109
113 dprintk("request for target %u kHz (relation: %u) for cpu %u\n", 110 pr_debug("request for target %u kHz (relation: %u) for cpu %u\n",
114 target_freq, relation, policy->cpu); 111 target_freq, relation, policy->cpu);
115 112
116 switch (relation) { 113 switch (relation) {
@@ -167,7 +164,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
167 } else 164 } else
168 *index = optimal.index; 165 *index = optimal.index;
169 166
170 dprintk("target is %u (%u kHz, %u)\n", *index, table[*index].frequency, 167 pr_debug("target is %u (%u kHz, %u)\n", *index, table[*index].frequency,
171 table[*index].index); 168 table[*index].index);
172 169
173 return 0; 170 return 0;
@@ -216,14 +213,14 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs);
216void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, 213void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
217 unsigned int cpu) 214 unsigned int cpu)
218{ 215{
219 dprintk("setting show_table for cpu %u to %p\n", cpu, table); 216 pr_debug("setting show_table for cpu %u to %p\n", cpu, table);
220 per_cpu(cpufreq_show_table, cpu) = table; 217 per_cpu(cpufreq_show_table, cpu) = table;
221} 218}
222EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr); 219EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr);
223 220
224void cpufreq_frequency_table_put_attr(unsigned int cpu) 221void cpufreq_frequency_table_put_attr(unsigned int cpu)
225{ 222{
226 dprintk("clearing show_table for cpu %u\n", cpu); 223 pr_debug("clearing show_table for cpu %u\n", cpu);
227 per_cpu(cpufreq_show_table, cpu) = NULL; 224 per_cpu(cpufreq_show_table, cpu) = NULL;
228} 225}
229EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr); 226EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 9343dd3de858..2845f6e67221 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -397,23 +397,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
397void cpufreq_frequency_table_put_attr(unsigned int cpu); 397void cpufreq_frequency_table_put_attr(unsigned int cpu);
398 398
399 399
400/*********************************************************************
401 * UNIFIED DEBUG HELPERS *
402 *********************************************************************/
403
404#define CPUFREQ_DEBUG_CORE 1
405#define CPUFREQ_DEBUG_DRIVER 2
406#define CPUFREQ_DEBUG_GOVERNOR 4
407
408#ifdef CONFIG_CPU_FREQ_DEBUG
409
410extern void cpufreq_debug_printk(unsigned int type, const char *prefix,
411 const char *fmt, ...);
412
413#else
414
415#define cpufreq_debug_printk(msg...) do { } while(0)
416
417#endif /* CONFIG_CPU_FREQ_DEBUG */
418
419#endif /* _LINUX_CPUFREQ_H */ 400#endif /* _LINUX_CPUFREQ_H */