[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>

authored by Atsushi Nemoto and committed by Ralf Baechle 800d1142 71efa38c

+3 -2
+3 -2
arch/mips/kernel/time.c
··· 163 unsigned long seq; 164 unsigned long lost; 165 unsigned long usec, sec; 166 - unsigned long max_ntp_tick = tick_usec - tickadj; 167 168 do { 169 seq = read_seqbegin(&xtime_lock); ··· 178 * Better to lose some accuracy than have time go backwards.. 179 */ 180 if (unlikely(time_adjust < 0)) { 181 usec = min(usec, max_ntp_tick); 182 183 if (lost) 184 usec += lost * max_ntp_tick; 185 } else if (unlikely(lost)) 186 - usec += lost * tick_usec; 187 188 sec = xtime.tv_sec; 189 usec += (xtime.tv_nsec / 1000);
··· 163 unsigned long seq; 164 unsigned long lost; 165 unsigned long usec, sec; 166 + unsigned long max_ntp_tick; 167 168 do { 169 seq = read_seqbegin(&xtime_lock); ··· 178 * Better to lose some accuracy than have time go backwards.. 179 */ 180 if (unlikely(time_adjust < 0)) { 181 + max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj; 182 usec = min(usec, max_ntp_tick); 183 184 if (lost) 185 usec += lost * max_ntp_tick; 186 } else if (unlikely(lost)) 187 + usec += lost * (USEC_PER_SEC / HZ); 188 189 sec = xtime.tv_sec; 190 usec += (xtime.tv_nsec / 1000);