aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-19 20:10:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-19 20:10:06 -0400
commit7d02093e29de9efc4a72d5e93baae9506969b789 (patch)
treea6fc2450132ae419934f6eb9d223baa338b7d782 /arch/cris/arch-v32
parent6e0b7b2c39b91b467270dd0bc383914f99e1fb28 (diff)
parente9ddbc075d95b2edf111247cdde16f33c31654a8 (diff)
Merge branch 'timers-for-linus-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: avr32: Fix typo in read_persistent_clock() sparc: Convert sparc to use read/update_persistent_clock cris: Convert cris to use read/update_persistent_clock m68k: Convert m68k to use read/update_persistent_clock m32r: Convert m32r to use read/update_peristent_clock blackfin: Convert blackfin to use read/update_persistent_clock ia64: Convert ia64 to use read/update_persistent_clock avr32: Convert avr32 to use read/update_persistent_clock h8300: Convert h8300 to use read/update_persistent_clock frv: Convert frv to use read/update_persistent_clock mn10300: Convert mn10300 to use read/update_persistent_clock alpha: Convert alpha to use read/update_persistent_clock xtensa: Fix unnecessary setting of xtime time: Clean up direct xtime usage in xen
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r--arch/cris/arch-v32/kernel/time.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c
index b1920d8de403..1ee0e1010228 100644
--- a/arch/cris/arch-v32/kernel/time.c
+++ b/arch/cris/arch-v32/kernel/time.c
@@ -44,7 +44,6 @@ unsigned long timer_regs[NR_CPUS] =
44#endif 44#endif
45}; 45};
46 46
47extern void update_xtime_from_cmos(void);
48extern int set_rtc_mmss(unsigned long nowtime); 47extern int set_rtc_mmss(unsigned long nowtime);
49extern int have_rtc; 48extern int have_rtc;
50 49
@@ -198,9 +197,6 @@ handle_watchdog_bite(struct pt_regs* regs)
198#endif 197#endif
199} 198}
200 199
201/* Last time the cmos clock got updated. */
202static long last_rtc_update = 0;
203
204/* 200/*
205 * timer_interrupt() needs to keep up the real-time clock, 201 * timer_interrupt() needs to keep up the real-time clock,
206 * as well as call the "do_timer()" routine every clocktick. 202 * as well as call the "do_timer()" routine every clocktick.
@@ -238,25 +234,6 @@ timer_interrupt(int irq, void *dev_id)
238 234
239 /* Call the real timer interrupt handler */ 235 /* Call the real timer interrupt handler */
240 do_timer(1); 236 do_timer(1);
241
242 /*
243 * If we have an externally synchronized Linux clock, then update
244 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
245 * called as close as possible to 500 ms before the new second starts.
246 *
247 * The division here is not time critical since it will run once in
248 * 11 minutes
249 */
250 if ((time_status & STA_UNSYNC) == 0 &&
251 xtime.tv_sec > last_rtc_update + 660 &&
252 (xtime.tv_nsec / 1000) >= 500000 - (tick_nsec / 1000) / 2 &&
253 (xtime.tv_nsec / 1000) <= 500000 + (tick_nsec / 1000) / 2) {
254 if (set_rtc_mmss(xtime.tv_sec) == 0)
255 last_rtc_update = xtime.tv_sec;
256 else
257 /* Do it again in 60 s */
258 last_rtc_update = xtime.tv_sec - 600;
259 }
260 return IRQ_HANDLED; 237 return IRQ_HANDLED;
261} 238}
262 239
@@ -309,23 +286,10 @@ time_init(void)
309 */ 286 */
310 loops_per_usec = 50; 287 loops_per_usec = 50;
311 288
312 if(RTC_INIT() < 0) { 289 if(RTC_INIT() < 0)
313 /* No RTC, start at 1980 */
314 xtime.tv_sec = 0;
315 xtime.tv_nsec = 0;
316 have_rtc = 0; 290 have_rtc = 0;
317 } else { 291 else
318 /* Get the current time */
319 have_rtc = 1; 292 have_rtc = 1;
320 update_xtime_from_cmos();
321 }
322
323 /*
324 * Initialize wall_to_monotonic such that adding it to
325 * xtime will yield zero, the tv_nsec field must be normalized
326 * (i.e., 0 <= nsec < NSEC_PER_SEC).
327 */
328 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
329 293
330 /* Start CPU local timer. */ 294 /* Start CPU local timer. */
331 cris_timer_init(); 295 cris_timer_init();