aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m32r/kernel/time.c')
-rw-r--r--arch/m32r/kernel/time.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 7a896893cd28..d8af155db984 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -38,7 +38,6 @@ extern void send_IPI_allbutself(int, int);
38extern void smp_local_timer_interrupt(struct pt_regs *); 38extern void smp_local_timer_interrupt(struct pt_regs *);
39#endif 39#endif
40 40
41extern unsigned long wall_jiffies;
42#define TICK_SIZE (tick_nsec / 1000) 41#define TICK_SIZE (tick_nsec / 1000)
43 42
44/* 43/*
@@ -108,24 +107,17 @@ void do_gettimeofday(struct timeval *tv)
108 unsigned long max_ntp_tick = tick_usec - tickadj; 107 unsigned long max_ntp_tick = tick_usec - tickadj;
109 108
110 do { 109 do {
111 unsigned long lost;
112
113 seq = read_seqbegin(&xtime_lock); 110 seq = read_seqbegin(&xtime_lock);
114 111
115 usec = do_gettimeoffset(); 112 usec = do_gettimeoffset();
116 lost = jiffies - wall_jiffies;
117 113
118 /* 114 /*
119 * If time_adjust is negative then NTP is slowing the clock 115 * If time_adjust is negative then NTP is slowing the clock
120 * so make sure not to go into next possible interval. 116 * so make sure not to go into next possible interval.
121 * Better to lose some accuracy than have time go backwards.. 117 * Better to lose some accuracy than have time go backwards..
122 */ 118 */
123 if (unlikely(time_adjust < 0)) { 119 if (unlikely(time_adjust < 0))
124 usec = min(usec, max_ntp_tick); 120 usec = min(usec, max_ntp_tick);
125 if (lost)
126 usec += lost * max_ntp_tick;
127 } else if (unlikely(lost))
128 usec += lost * tick_usec;
129 121
130 sec = xtime.tv_sec; 122 sec = xtime.tv_sec;
131 usec += (xtime.tv_nsec / 1000); 123 usec += (xtime.tv_nsec / 1000);
@@ -158,7 +150,6 @@ int do_settimeofday(struct timespec *tv)
158 * made, and then undo it! 150 * made, and then undo it!
159 */ 151 */
160 nsec -= do_gettimeoffset() * NSEC_PER_USEC; 152 nsec -= do_gettimeoffset() * NSEC_PER_USEC;
161 nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
162 153
163 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); 154 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
164 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); 155 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);