diff options
author | Dave Jones <davej@redhat.com> | 2005-05-31 22:03:46 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2005-05-31 22:03:46 -0400 |
commit | c5d28fb297efaa97c4b90e36f9dff3066e7f2778 (patch) | |
tree | b0636983104860fa15d9054d29ec9e8b912642cd /arch/i386/kernel/timers/timer_tsc.c | |
parent | 91350ed49bf3613e243c2e216228cd4ae8f32516 (diff) |
[CPUFREQ] Recalibrate cpu_khz [2/2]
Some cpufreq drivers (at that time, only powernow-k7) need to recalibrate the
cpu_khz at runtime.
Signed-off-by: Bruno Ducrot <ducrot@poupinou.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/i386/kernel/timers/timer_tsc.c')
-rw-r--r-- | arch/i386/kernel/timers/timer_tsc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index 7926d967be00..180444d87824 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c | |||
@@ -320,6 +320,26 @@ core_initcall(cpufreq_tsc); | |||
320 | static inline void cpufreq_delayed_get(void) { return; } | 320 | static inline void cpufreq_delayed_get(void) { return; } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | int recalibrate_cpu_khz(void) | ||
324 | { | ||
325 | #ifndef CONFIG_SMP | ||
326 | unsigned long cpu_khz_old = cpu_khz; | ||
327 | |||
328 | if (cpu_has_tsc) { | ||
329 | init_cpu_khz(); | ||
330 | cpu_data[0].loops_per_jiffy = | ||
331 | cpufreq_scale(cpu_data[0].loops_per_jiffy, | ||
332 | cpu_khz_old, | ||
333 | cpu_khz); | ||
334 | return 0; | ||
335 | } else | ||
336 | return -ENODEV; | ||
337 | #else | ||
338 | return -ENODEV; | ||
339 | #endif | ||
340 | } | ||
341 | EXPORT_SYMBOL(recalibrate_cpu_khz); | ||
342 | |||
323 | static void mark_offset_tsc(void) | 343 | static void mark_offset_tsc(void) |
324 | { | 344 | { |
325 | unsigned long lost,delay; | 345 | unsigned long lost,delay; |