]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] use cycle_t instead of u64 in struct time_interpolator
authorHelge Deller <deller@gmx.de>
Sat, 10 Feb 2007 09:45:40 +0000 (01:45 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 11 Feb 2007 18:51:31 +0000 (10:51 -0800)
The 32bit and 64bit PARISC Linux kernels suffers from the problem, that the
gettimeofday() call sometimes returns non-monotonic times.

The easiest way to fix this, is to drop the PARISC-specific implementation
and switch over to the generic TIME_INTERPOLATION framework.

But in order to make it even compile on 32bit PARISC, the patch below which
touches the generic Linux code, is mandatory.

More information and the full patch with the parisc-specific changes is included in this thread: http://lists.parisc-linux.org/pipermail/parisc-linux/2006-December/031003.html

As far as I could see, this patch does not change anything for the existing
architectures which use this framework (IA64 and SPARC64), since "cycles_t"
is defined there as unsigned 64bit-integer anyway (which then makes this
patch a no-change for them).

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <linux-arch@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/timex.h
kernel/timer.c

index db501dc23c299e52af3ac357cd7af05478465d23..9a24e500c3113291b9304e218b935fdc300ab87a 100644 (file)
@@ -255,10 +255,10 @@ struct time_interpolator {
        u8 jitter;                      /* if set compensate for fluctuations */
        u32 nsec_per_cyc;               /* set by register_time_interpolator() */
        void *addr;                     /* address of counter or function */
-       u64 mask;                       /* mask the valid bits of the counter */
+       cycles_t mask;                  /* mask the valid bits of the counter */
        unsigned long offset;           /* nsec offset at last update of interpolator */
        u64 last_counter;               /* counter value in units of the counter at last update */
-       u64 last_cycle;                 /* Last timer value if TIME_SOURCE_JITTER is set */
+       cycles_t last_cycle;            /* Last timer value if TIME_SOURCE_JITTER is set */
        u64 frequency;                  /* frequency in counts/second */
        long drift;                     /* drift in parts-per-million (or -1) */
        unsigned long skips;            /* skips forward */
index c2a8ccfc288210fb45a3ae199c94572edbbc72b4..d38801a958665913e33c7bf82d92c5c1381cecad 100644 (file)
@@ -1624,7 +1624,7 @@ struct time_interpolator *time_interpolator __read_mostly;
 static struct time_interpolator *time_interpolator_list __read_mostly;
 static DEFINE_SPINLOCK(time_interpolator_lock);
 
-static inline u64 time_interpolator_get_cycles(unsigned int src)
+static inline cycles_t time_interpolator_get_cycles(unsigned int src)
 {
        unsigned long (*x)(void);
 
@@ -1650,8 +1650,8 @@ static inline u64 time_interpolator_get_counter(int writelock)
 
        if (time_interpolator->jitter)
        {
-               u64 lcycle;
-               u64 now;
+               cycles_t lcycle;
+               cycles_t now;
 
                do {
                        lcycle = time_interpolator->last_cycle;