Skip to content

Commit

Permalink
sh: Account for INITIAL_JIFFIES when using jiffies clocksource.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mundt committed May 11, 2009
1 parent d9d674e commit 780f98f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sh/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 780f98f

Please sign in to comment.