mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [2/3] Cleanup: Unify tsc_unstable and tsc_disable
@ 2007-03-03 21:41 Guillaume Chazarain
  0 siblings, 0 replies; only message in thread
From: Guillaume Chazarain @ 2007-03-03 21:41 UTC (permalink / raw)
  To: Ingo Molnar, Andi Kleen, linux-kernel

tsc_unstable and tsc_disable serve the same purpose.

Signed-off-by: Guillaume Chazarain <guichaz@yahoo.fr>
---

diff -r 6cd70e2b4c1f arch/i386/kernel/tsc.c
--- a/arch/i386/kernel/tsc.c	Sat Mar 03 21:39:09 2007 +0100
+++ b/arch/i386/kernel/tsc.c	Sat Mar 03 22:13:03 2007 +0100
@@ -49,16 +49,6 @@ static int __init tsc_setup(char *str)

 __setup("notsc", tsc_setup);

-/*
- * code to mark and check if the TSC is unstable
- * due to cpufreq or due to unsynced TSCs
- */
-static int tsc_unstable;
-
-static inline int check_tsc_unstable(void)
-{
-	return tsc_unstable;
-}

 /* Accellerators for sched_clock()
  * convert from cycles(64bits) => nanoseconds (64bits)
@@ -108,7 +98,7 @@ unsigned long long sched_clock(void)
 	/*
 	 * Fall back to jiffies if there's no TSC available:
 	 */
-	if (tsc_unstable || unlikely(tsc_disable))
+	if (unlikely(tsc_disable))
 		/* No locking but a rare wrong value is not a big deal: */
 		return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);

@@ -312,8 +302,8 @@ static struct clocksource clocksource_ts

 void mark_tsc_unstable(void)
 {
-	if (!tsc_unstable) {
-		tsc_unstable = 1;
+	if (!tsc_disable) {
+		tsc_disable = 1;
 		/* Can be called before registration */
 		if (clocksource_tsc.mult)
 			clocksource_change_rating(&clocksource_tsc, 0);
@@ -327,7 +317,7 @@ static int __init dmi_mark_tsc_unstable(
 {
 	printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
 		       d->ident);
-	tsc_unstable = 1;
+	tsc_disable = 1;
 	return 0;
 }

@@ -350,7 +340,7 @@ static struct dmi_system_id __initdata b
  */
 __cpuinit int unsynchronized_tsc(void)
 {
-	if (!cpu_has_tsc || tsc_unstable)
+	if (!cpu_has_tsc || tsc_disable)
 		return 1;
 	/*
 	 * Intel systems are normally all synchronized.
@@ -359,9 +349,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 tsc_unstable;
+			tsc_disable = 1;
+	}
+	return tsc_disable;
 }

 /*
@@ -396,7 +386,7 @@ static int __init init_tsc_clocksource(v
 		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 (tsc_disable) {
 			clocksource_tsc.rating = 0;
 			clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
 		}


-- 
Guillaume

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-03 21:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-03 21:41 [2/3] Cleanup: Unify tsc_unstable and tsc_disable Guillaume Chazarain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®