aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
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 /arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
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>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c45
1 files changed, 21 insertions, 24 deletions
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