diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2011-03-27 09:04:46 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-05-04 11:50:57 -0400 |
commit | 2d06d8c49afdcc9bb35a85039fa50f0fe35bd40e (patch) | |
tree | d933a68fc71f6e2c3b95b744a87fa1d817bea3d6 /arch/x86/kernel/cpu/cpufreq/powernow-k7.c | |
parent | 27ecddc2a9f99ce4ac9a59a0acd77f7100b6d034 (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/powernow-k7.c')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k7.c | 33 |
1 files changed, 14 insertions, 19 deletions
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. */ |
73 | static const int mobile_vid_table[32] = { | 72 | static 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. */ |
82 | static const int fid_codes[32] = { | 80 | static const int fid_codes[32] = { |
@@ -103,9 +101,6 @@ static unsigned int fsb; | |||
103 | static unsigned int latency; | 101 | static unsigned int latency; |
104 | static char have_a0; | 102 | static char have_a0; |
105 | 103 | ||
106 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, \ | ||
107 | "powernow-k7", msg) | ||
108 | |||
109 | static int check_fsb(unsigned int fsbspeed) | 104 | static 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 | ||
454 | static void print_pst_entry(struct pst_s *pst, unsigned int j) | 449 | static 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. " |