diff options
Diffstat (limited to 'arch/x86/kernel/tsc_32.c')
| -rw-r--r-- | arch/x86/kernel/tsc_32.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c index 65b70637ad9..6240922e497 100644 --- a/arch/x86/kernel/tsc_32.c +++ b/arch/x86/kernel/tsc_32.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #include <linux/sched.h> | 1 | #include <linux/sched.h> |
| 2 | #include <linux/clocksource.h> | 2 | #include <linux/clocksource.h> |
| 3 | #include <linux/workqueue.h> | 3 | #include <linux/workqueue.h> |
| 4 | #include <linux/delay.h> | ||
| 4 | #include <linux/cpufreq.h> | 5 | #include <linux/cpufreq.h> |
| 5 | #include <linux/jiffies.h> | 6 | #include <linux/jiffies.h> |
| 6 | #include <linux/init.h> | 7 | #include <linux/init.h> |
| @@ -286,7 +287,6 @@ core_initcall(cpufreq_tsc); | |||
| 286 | 287 | ||
| 287 | /* clock source code */ | 288 | /* clock source code */ |
| 288 | 289 | ||
| 289 | static unsigned long current_tsc_khz; | ||
| 290 | static struct clocksource clocksource_tsc; | 290 | static struct clocksource clocksource_tsc; |
| 291 | 291 | ||
| 292 | /* | 292 | /* |
| @@ -404,6 +404,7 @@ static inline void check_geode_tsc_reliable(void) { } | |||
| 404 | void __init tsc_init(void) | 404 | void __init tsc_init(void) |
| 405 | { | 405 | { |
| 406 | int cpu; | 406 | int cpu; |
| 407 | u64 lpj; | ||
| 407 | 408 | ||
| 408 | if (!cpu_has_tsc || tsc_disabled > 0) | 409 | if (!cpu_has_tsc || tsc_disabled > 0) |
| 409 | return; | 410 | return; |
| @@ -416,6 +417,10 @@ void __init tsc_init(void) | |||
| 416 | return; | 417 | return; |
| 417 | } | 418 | } |
| 418 | 419 | ||
| 420 | lpj = ((u64)tsc_khz * 1000); | ||
| 421 | do_div(lpj, HZ); | ||
| 422 | lpj_fine = lpj; | ||
| 423 | |||
| 419 | /* now allow native_sched_clock() to use rdtsc */ | 424 | /* now allow native_sched_clock() to use rdtsc */ |
| 420 | tsc_disabled = 0; | 425 | tsc_disabled = 0; |
| 421 | 426 | ||
| @@ -439,9 +444,8 @@ void __init tsc_init(void) | |||
| 439 | 444 | ||
| 440 | unsynchronized_tsc(); | 445 | unsynchronized_tsc(); |
| 441 | check_geode_tsc_reliable(); | 446 | check_geode_tsc_reliable(); |
| 442 | current_tsc_khz = tsc_khz; | 447 | clocksource_tsc.mult = clocksource_khz2mult(tsc_khz, |
| 443 | clocksource_tsc.mult = clocksource_khz2mult(current_tsc_khz, | 448 | clocksource_tsc.shift); |
| 444 | clocksource_tsc.shift); | ||
| 445 | /* lower the rating if we already know its unstable: */ | 449 | /* lower the rating if we already know its unstable: */ |
| 446 | if (check_tsc_unstable()) { | 450 | if (check_tsc_unstable()) { |
| 447 | clocksource_tsc.rating = 0; | 451 | clocksource_tsc.rating = 0; |
