From f2a43f1a7ed27eea024460166a2a01f5f375bab9 Mon Sep 17 00:00:00 2001
From: Andi Kleen <ak@muc.de>
Date: Tue, 19 Oct 2004 18:11:41 -0700
Subject: [PATCH] [PATCH] x86_64: add notsc option

Add an notsc option so that it can be turned off again.

This may be useful on the Summit, but will only work when there is a HPET
fallback.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
 arch/x86_64/kernel/time.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index fcb5919b4c52..a33b14f81bdf 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -53,10 +53,10 @@ spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
 spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED;
 
 static int nohpet __initdata = 0;
+static int notsc __initdata = 0;
 
 #undef HPET_HACK_ENABLE_DANGEROUS
 
-
 unsigned int cpu_khz;					/* TSC clocks / usec, not used here */
 unsigned long hpet_period;				/* fsecs / HPET clock */
 unsigned long hpet_tick;				/* HPET clocks / interrupt */
@@ -918,10 +918,13 @@ void __init time_init_smp(void)
 	 * Exceptions:
 	 * IBM Summit. Will need to be special cased later.
  	 * AMD dual core may also not need HPET. Check me.
+	 *
+	 * Can be turned off with "notsc".
 	 */
-	if (vxtime.hpet_address &&
-	    num_online_cpus() > 1 &&
-	    boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
+	if (num_online_cpus() > 1 &&
+	    boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+		notsc = 1;
+	if (vxtime.hpet_address && notsc) {
 		timetype = "HPET";
 		vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
 		vxtime.mode = VXTIME_HPET;
@@ -1217,3 +1220,14 @@ static int __init nohpet_setup(char *s)
 } 
 
 __setup("nohpet", nohpet_setup);
+
+
+static int __init notsc_setup(char *s)
+{
+	notsc = 1;
+	return 0;
+}
+
+__setup("notsc", notsc_setup);
+
+
-- 
2.30.9