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/gx-suspmod.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/gx-suspmod.c')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/gx-suspmod.c | 21 |
1 files changed, 9 insertions, 12 deletions
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) |