sh: Account for INITIAL_JIFFIES when using jiffies clocksource.
authorPaul Mundt <lethal@linux-sh.org>
Mon, 11 May 2009 03:15:14 +0000 (12:15 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 11 May 2009 03:15:14 +0000 (12:15 +0900)
In the case where we fall back on the generic jiffies clocksource,
INITIAL_JIFFIES needs to be accounted for so that printk times aren't
completely skewed.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/time.c

index e0aa769481ff0b4da2eb96e22b6abb563b5c2986..a77838f539f84f4334629a6416799eb15962ef5f 100644 (file)
@@ -104,7 +104,7 @@ unsigned long long sched_clock(void)
 
        /* jiffies based sched_clock if no clocksource is installed */
        if (!clocksource_sh.rating)
-               return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
+               return (jiffies_64 - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ);
 
        cycles = clocksource_sh.read(&clocksource_sh);
        return cyc2ns(&clocksource_sh, cycles);
This page took 0.02893 seconds and 5 git commands to generate.