diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-03-01 07:16:26 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-03-01 20:22:22 +0100 |
commit | 800d11420dfdad3a50630ff424d7782660ad558c (patch) | |
tree | f13cd691d6f36eb4fbe50f97b9a5ea2156ccfa6c | |
parent | Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 (diff) | |
download | linux-800d11420dfdad3a50630ff424d7782660ad558c.tar.xz linux-800d11420dfdad3a50630ff424d7782660ad558c.zip |
[MIPS] Use USECS_PER_SEC / HZ instead of tick_usec in do_gettimeofday.
The 'tick_usec' is USER_HZ period in usec. do_gettimeofday() should
use kernel HZ value.
Here is a patch for MIPS. It seems m32r, m68k and sparc have same
problem though their HZ and USER_HZ are same for now.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/time.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 7050b4ffffcd..42c94c771afb 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -163,7 +163,7 @@ void do_gettimeofday(struct timeval *tv) unsigned long seq; unsigned long lost; unsigned long usec, sec; - unsigned long max_ntp_tick = tick_usec - tickadj; + unsigned long max_ntp_tick; do { seq = read_seqbegin(&xtime_lock); @@ -178,12 +178,13 @@ void do_gettimeofday(struct timeval *tv) * Better to lose some accuracy than have time go backwards.. */ if (unlikely(time_adjust < 0)) { + max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj; usec = min(usec, max_ntp_tick); if (lost) usec += lost * max_ntp_tick; } else if (unlikely(lost)) - usec += lost * tick_usec; + usec += lost * (USEC_PER_SEC / HZ); sec = xtime.tv_sec; usec += (xtime.tv_nsec / 1000); |