linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: x86 timer clean ups
       [not found] <200210182133.g9ILX0F15855@eng2.beaverton.ibm.com>
@ 2002-10-18 21:37 ` john stultz
  0 siblings, 0 replies; 2+ messages in thread
From: john stultz @ 2002-10-18 21:37 UTC (permalink / raw)
  To: James Bottomley; +Cc: lkml

>  I need a flag for the TSC stuff that allows me to turn it off completely 
> (the 
>  voyagers run CPUs from physically different clocks, and TSC drift causes 
> huge 
>  jitters in this case).
>  
>  How about two compile options:
>  
>  CONFIG_X86_TSC meaning check for TSC and use it if it's OK
>  CONFIG_X86_PIT meaning use the PIT timer if the TSC isn't OK (or isn't 
> wanted)

Hmmm. I was thinking of possibly doing something similar to the 2.4
CONFIG_X86_HAS_TSC and CONFGI_X86_TSC_DISABLE, but I believe Linus
wasn't super happy about negative config options. You're usage sounds
reasonable, but since this is a cleanup item, do you mind if we both
look at the issue a bit more next week?

>  P.S. what about this CONFIG_X86_CYCLONE thing?  It doesn't seem to be 
> hooked 
>  into the timer infrastructure, should it be?

Not right this second. I'm waiting for the summit subarch code to
stabilize, then I'll hook it in correctly.

thanks
-john


^ permalink raw reply	[flat|nested] 2+ messages in thread

* x86 timer clean ups
@ 2002-10-18 16:02 James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2002-10-18 16:02 UTC (permalink / raw)
  To: greg; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

Hi Greg,

I need a flag for the TSC stuff that allows me to turn it off completely (the 
voyagers run CPUs from physically different clocks, and TSC drift causes huge 
jitters in this case).

How about two compile options:

CONFIG_X86_TSC meaning check for TSC and use it if it's OK
CONFIG_X86_PIT meaning use the PIT timer if the TSC isn't OK (or isn't wanted)

That way, arch's that know the TSC is OK in every case have

CONFIG_X86_TSC y
CONFIG_X86_PIT n

Arches that aren't sure if the TSC will be OK or not have

CONFIG_X86_TSC y
CONFIG_X86_PIT y

and arches that really don't want it at all have

CONFIG_X86_TSC n
CONFIG_X86_PIT y

The attached patch does all this. (I've also put it up on bkbits at 
http://linux-voyager.bkbits.net/timer-2.5).

James

P.S. what about this CONFIG_X86_CYCLONE thing?  It doesn't seem to be hooked 
into the timer infrastructure, should it be?



[-- Attachment #2: tmp.diff --]
[-- Type: text/plain , Size: 3872 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.806   -> 1.809  
#	arch/i386/kernel/timers/Makefile	1.2     -> 1.3    
#	 arch/i386/config.in	1.59    -> 1.60   
#	arch/i386/kernel/timers/timer.c	1.3     -> 1.4    
#	arch/i386/kernel/timers/timer_pit.c	1.3.1.1 -> 1.6    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/18	jejb@mulgrave.(none)	1.807
# Merge mulgrave.(none):/home/jejb/BK/timer-2.5
# into mulgrave.(none):/home/jejb/BK/timer-new-2.5
# --------------------------------------------
# 02/10/18	jejb@mulgrave.(none)	1.808
# [timer_pit.c] remove duplicate asm/mpspec.h include
# --------------------------------------------
# 02/10/18	jejb@mulgrave.(none)	1.809
# [x86 timers] make timer type compile time configurable
# --------------------------------------------
#
diff -Nru a/arch/i386/config.in b/arch/i386/config.in
--- a/arch/i386/config.in	Fri Oct 18 10:45:42 2002
+++ b/arch/i386/config.in	Fri Oct 18 10:45:42 2002
@@ -43,6 +43,7 @@
    define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
    define_bool CONFIG_X86_PPRO_FENCE y
    define_bool CONFIG_X86_F00F_BUG y
+   define_bool CONFIG_X86_PIT y
 else
    define_bool CONFIG_X86_WP_WORKS_OK y
    define_bool CONFIG_X86_INVLPG y
@@ -59,6 +60,7 @@
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_PPRO_FENCE y
    define_bool CONFIG_X86_F00F_BUG y
+   define_bool CONFIG_X86_PIT y
 fi
 if [ "$CONFIG_M586" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
@@ -66,12 +68,14 @@
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_PPRO_FENCE y
    define_bool CONFIG_X86_F00F_BUG y
+   define bool CONFIG_X86_PIT y
 fi
 if [ "$CONFIG_M586TSC" = "y" ]; then
    define_int  CONFIG_X86_L1_CACHE_SHIFT 5
    define_bool CONFIG_X86_USE_STRING_486 y
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_x86_PIT y
    define_bool CONFIG_X86_PPRO_FENCE y
    define_bool CONFIG_X86_F00F_BUG y
 fi
@@ -80,6 +84,7 @@
    define_bool CONFIG_X86_USE_STRING_486 y
    define_bool CONFIG_X86_ALIGNMENT_16 y
    define_bool CONFIG_X86_TSC y
+   define_bool CONFIG_X86_PIT y
    define_bool CONFIG_X86_GOOD_APIC y
    define_bool CONFIG_X86_PPRO_FENCE y
    define_bool CONFIG_X86_F00F_BUG y
diff -Nru a/arch/i386/kernel/timers/Makefile b/arch/i386/kernel/timers/Makefile
--- a/arch/i386/kernel/timers/Makefile	Fri Oct 18 10:45:42 2002
+++ b/arch/i386/kernel/timers/Makefile	Fri Oct 18 10:45:42 2002
@@ -4,8 +4,8 @@
 
 obj-y := timer.o
 
-obj-y += timer_tsc.o
-obj-y += timer_pit.o
-obj-$(CONFIG_X86_CYCLONE)   += timer_cyclone.o
+obj-$(CONFIG_X86_TSC)		+= timer_tsc.o
+obj-$(CONFIG_X86_PIT)		+= timer_pit.o
+obj-$(CONFIG_X86_CYCLONE)	+= timer_cyclone.o
 
 include $(TOPDIR)/Rules.make
diff -Nru a/arch/i386/kernel/timers/timer.c b/arch/i386/kernel/timers/timer.c
--- a/arch/i386/kernel/timers/timer.c	Fri Oct 18 10:45:42 2002
+++ b/arch/i386/kernel/timers/timer.c	Fri Oct 18 10:45:42 2002
@@ -7,8 +7,10 @@
 
 /* list of timers, ordered by preference, NULL terminated */
 static struct timer_opts* timers[] = {
+#ifdef CONFIG_X86_TSC
 	&timer_tsc,
-#ifndef CONFIG_X86_TSC
+#endif
+#ifdef CONFIG_X86_PIT
 	&timer_pit,
 #endif
 	NULL,
diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
--- a/arch/i386/kernel/timers/timer_pit.c	Fri Oct 18 10:45:42 2002
+++ b/arch/i386/kernel/timers/timer_pit.c	Fri Oct 18 10:45:42 2002
@@ -8,7 +8,9 @@
 #include <linux/device.h>
 #include <asm/mpspec.h>
 #include <asm/timer.h>
+#include <asm/smp.h>
 #include <asm/io.h>
+#include <asm/arch_hooks.h>
 
 extern spinlock_t i8259A_lock;
 extern spinlock_t i8253_lock;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-18 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200210182133.g9ILX0F15855@eng2.beaverton.ibm.com>
2002-10-18 21:37 ` x86 timer clean ups john stultz
2002-10-18 16:02 James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).