Skip to content

Commit

Permalink
[SPARC64]: Fix sched_clock() wrapping every ~17 seconds.
Browse files Browse the repository at this point in the history
Unfortunately, sparc64 doesn't have an easy way to do a "64 X 64 -->
128" bit multiply like PowerPC and IA64 do.  We were doing a
"64 X 64 --> 64" bit multiple which causes overflow very quickly with
a 30-bit quotient shift.

So use a quotientshift count of 10 instead of 30, just like x86 and
ARM do.

This also fixes the wrapping of printk timestamp values every ~17
seconds.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller authored and David S. Miller committed Sep 24, 2006
1 parent 1ab9dd0 commit e17ba8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ static struct time_interpolator sparc64_cpu_interpolator = {
};

/* The quotient formula is taken from the IA64 port. */
#define SPARC64_NSEC_PER_CYC_SHIFT 30UL
#define SPARC64_NSEC_PER_CYC_SHIFT 10UL
void __init time_init(void)
{
unsigned long clock = sparc64_init_timers();
Expand Down

0 comments on commit e17ba8f

Please sign in to comment.