[PATCH] boot time parameter to turn of TSC usage

Stephen Hemminger (shemminger@osdl.org)
18 Mar 2003 16:38:20 -0800


For machines that don't want to cooperate and have bad TSC counter and/or
change CPU frequency without change support.

This fixes the problem on Jerry Cooperstein's PIII laptop.
Could be useful for other people and tech support situations.

Please consider applying.
Thanks
Steve

diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
--- a/arch/i386/kernel/timers/timer_tsc.c Tue Mar 18 15:28:10 2003
+++ b/arch/i386/kernel/timers/timer_tsc.c Tue Mar 18 15:28:10 2003
@@ -15,6 +15,7 @@
#include <asm/processor.h>

int tsc_disable __initdata = 0;
+static int tsc_clock_disable __initdata = 0;

extern spinlock_t i8253_lock;

@@ -241,6 +242,13 @@
};
#endif

+/* Don't use TSC for time of day clock */
+static int __init tsc_noclock_setup(char *str)
+{
+ tsc_clock_disable = 1;
+ return 1;
+}
+__setup("notsclock", tsc_noclock_setup);

static int init_tsc(void)
{
@@ -273,7 +281,7 @@
cpufreq_register_notifier(&time_cpufreq_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
#endif

- if (cpu_has_tsc) {
+ if (cpu_has_tsc && !tsc_clock_disable) {
unsigned long tsc_quotient = calibrate_tsc();
if (tsc_quotient) {
fast_gettimeoffset_quotient = tsc_quotient;

-
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/