Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66176
b: refs/heads/master
c: f5ff0a2
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Oct 11, 2007
1 parent 8d1061e commit a2f8c43
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4680576edecb640f64936bd9b92add0a56027b61
refs/heads/master: f5ff0a280201c9cbfb6e9eb4bafdb465c2269ed3
4 changes: 4 additions & 0 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,10 @@ config GENERIC_TIME
bool
default y

config GENERIC_CMOS_UPDATE
bool
default y

config SCHED_NO_NO_OMIT_FRAME_POINTER
bool
default y
Expand Down
24 changes: 4 additions & 20 deletions trunk/arch/mips/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ unsigned long (*rtc_mips_get_time)(void) = null_rtc_get_time;
int (*rtc_mips_set_time)(unsigned long) = null_rtc_set_time;
int (*rtc_mips_set_mmss)(unsigned long);

int update_persistent_clock(struct timespec now)
{
return rtc_mips_set_mmss(now.tv_sec);
}

/* how many counter cycles in a jiffy */
static unsigned long cycles_per_jiffy __read_mostly;
Expand Down Expand Up @@ -125,9 +129,6 @@ static void __init c0_hpt_timer_init(void)
int (*mips_timer_state)(void);
void (*mips_timer_ack)(void);

/* last time when xtime and rtc are sync'ed up */
static long last_rtc_update;

/*
* local_timer_interrupt() does profiling and process accounting
* on a per-CPU basis.
Expand Down Expand Up @@ -159,23 +160,6 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
*/
do_timer(1);

/*
* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. rtc_mips_set_time() has to be
* called as close as possible to 500 ms before the new second starts.
*/
if (ntp_synced() &&
xtime.tv_sec > last_rtc_update + 660 &&
(xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
(xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
if (rtc_mips_set_mmss(xtime.tv_sec) == 0) {
last_rtc_update = xtime.tv_sec;
} else {
/* do it again in 60 s */
last_rtc_update = xtime.tv_sec - 600;
}
}

write_sequnlock(&xtime_lock);

/*
Expand Down
18 changes: 0 additions & 18 deletions trunk/arch/mips/sgi-ip27/ip27-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#define TICK_SIZE (tick_nsec / 1000)

static unsigned long ct_cur[NR_CPUS]; /* What counter should be at next timer irq */
static long last_rtc_update; /* Last time the rtc clock got updated */

#if 0
static int set_rtc_mmss(unsigned long nowtime)
Expand Down Expand Up @@ -113,23 +112,6 @@ void ip27_rt_timer_interrupt(void)

update_process_times(user_mode(get_irq_regs()));

/*
* If we have an externally synchronized Linux clock, then update
* RTC clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
* called as close as possible to when a second starts.
*/
if (ntp_synced() &&
xtime.tv_sec > last_rtc_update + 660 &&
(xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
(xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
if (rtc_mips_set_time(xtime.tv_sec) == 0) {
last_rtc_update = xtime.tv_sec;
} else {
last_rtc_update = xtime.tv_sec - 600;
/* do it again in 60 s */
}
}

write_sequnlock(&xtime_lock);
irq_exit();
}
Expand Down

0 comments on commit a2f8c43

Please sign in to comment.