From: Paul Mundt Date: Mon, 11 May 2009 03:15:14 +0000 (+0900) Subject: sh: Account for INITIAL_JIFFIES when using jiffies clocksource. X-Git-Tag: v2.6.31-rc1~392^2~41^2~35 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=780f98ff1fa9cfcab177f6b5ab09b11321f1e5c8;p=karo-tx-linux.git sh: Account for INITIAL_JIFFIES when using jiffies clocksource. 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 --- diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index e0aa769481ff..a77838f539f8 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c @@ -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);