Disable tsc if apm is in use

From: Pavel Machek (pavel@ucw.cz)
Date: Sun Jul 23 2000 - 15:33:21 EST


Hi!

It is bad idea to use tsc in case apm is messing with speeds.

BTW I do't like idea of clearing bits in feature: cpu _has_ that
feature, it is just that linux refuses to use it.
                                                        Pavel

--- clean/arch/i386/kernel/setup.c Wed Jul 12 21:02:29 2000
+++ linux/arch/i386/kernel/setup.c Sun Jul 23 22:27:47 2000
@@ -1594,6 +1594,7 @@
         int i, n;
 
         for (n = 0; n < NR_CPUS; n++, c++) {
+ extern int use_tsc;
 #ifdef CONFIG_SMP
                 if (!(cpu_online_map & (1<<n)))
                         continue;
@@ -1676,6 +1677,7 @@
                                 "fpu_exception\t: %s\n"
                                 "cpuid level\t: %d\n"
                                 "wp\t\t: %s\n"
+ "use_tsc\t\t: %s\n"
                                 "flags\t\t:",
                              c->fdiv_bug ? "yes" : "no",
                              c->hlt_works_ok ? "no" : "yes",
@@ -1685,7 +1687,8 @@
                              c->hard_math ? "yes" : "no",
                              (c->hard_math && ignore_irq13) ? "yes" : "no",
                              c->cpuid_level,
- c->wp_works_ok ? "yes" : "no");
+ c->wp_works_ok ? "yes" : "no",
+ use_tsc ? "yes" : "no");
 
                 for ( i = 0 ; i < 32 ; i++ )
                         if ( c->x86_capability & (1 << i) )
@@ -1731,6 +1734,9 @@
 
         if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
                 clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
+#ifdef CONFIG_APM_CPU_IDLE
+ tsc_disable = 1;
+#endif
 #ifndef CONFIG_X86_TSC
         if (tsc_disable && cpu_has_tsc) {
                 printk("Disabling TSC...\n");

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:20 EST