lkml.org 
[lkml]   [2007]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [13/58] x86: Separate checking of unsynchronized and unstable TSC
Date

Preparationary patch for the new sched/printk_clock()

Signed-off-by: Andi Kleen <ak@suse.de>

---
arch/i386/kernel/tsc.c | 9 ++++-----
arch/x86_64/kernel/tsc.c | 5 +----
2 files changed, 5 insertions(+), 9 deletions(-)
Index: linux/arch/i386/kernel/tsc.c
===================================================================
--- linux.orig/arch/i386/kernel/tsc.c
+++ linux/arch/i386/kernel/tsc.c
@@ -331,7 +331,7 @@ static struct dmi_system_id __initdata b
*/
__cpuinit int unsynchronized_tsc(void)
{
- if (!cpu_has_tsc || tsc_unstable)
+ if (!cpu_has_tsc)
return 1;
/*
* Intel systems are normally all synchronized.
@@ -340,9 +340,9 @@ __cpuinit int unsynchronized_tsc(void)
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
/* assume multi socket systems are not synchronized: */
if (num_possible_cpus() > 1)
- tsc_unstable = 1;
+ return 1;
}
- return tsc_unstable;
+ return 0;
}

/*
@@ -386,13 +386,12 @@ void __init tsc_init(void)
/* Check and install the TSC clocksource */
dmi_check_system(bad_tsc_dmi_table);

- unsynchronized_tsc();
check_geode_tsc_reliable();
current_tsc_khz = tsc_khz;
clocksource_tsc.mult = clocksource_khz2mult(current_tsc_khz,
clocksource_tsc.shift);
/* lower the rating if we already know its unstable: */
- if (check_tsc_unstable()) {
+ if (check_tsc_unstable() || unsynchronized_tsc()) {
clocksource_tsc.rating = 0;
clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
} else
Index: linux/arch/x86_64/kernel/tsc.c
===================================================================
--- linux.orig/arch/x86_64/kernel/tsc.c
+++ linux/arch/x86_64/kernel/tsc.c
@@ -144,9 +144,6 @@ static int tsc_unstable = 0;
*/
__cpuinit int unsynchronized_tsc(void)
{
- if (tsc_unstable)
- return 1;
-
#ifdef CONFIG_SMP
if (apic_is_clustered_box())
return 1;
@@ -218,7 +215,7 @@ void __init init_tsc_clocksource(void)
if (!notsc) {
clocksource_tsc.mult = clocksource_khz2mult(tsc_khz,
clocksource_tsc.shift);
- if (check_tsc_unstable())
+ if (unsynchronized_tsc() || check_tsc_unstable())
clocksource_tsc.rating = 0;

clocksource_register(&clocksource_tsc);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-07-19 12:05    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site