Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] Use generic NTP code for all MIPS platforms

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+8 -38
+4
arch/mips/Kconfig
··· 670 670 bool 671 671 default y 672 672 673 + config GENERIC_CMOS_UPDATE 674 + bool 675 + default y 676 + 673 677 config SCHED_NO_NO_OMIT_FRAME_POINTER 674 678 bool 675 679 default y
+4 -20
arch/mips/kernel/time.c
··· 67 67 int (*rtc_mips_set_time)(unsigned long) = null_rtc_set_time; 68 68 int (*rtc_mips_set_mmss)(unsigned long); 69 69 70 + int update_persistent_clock(struct timespec now) 71 + { 72 + return rtc_mips_set_mmss(now.tv_sec); 73 + } 70 74 71 75 /* how many counter cycles in a jiffy */ 72 76 static unsigned long cycles_per_jiffy __read_mostly; ··· 129 125 int (*mips_timer_state)(void); 130 126 void (*mips_timer_ack)(void); 131 127 132 - /* last time when xtime and rtc are sync'ed up */ 133 - static long last_rtc_update; 134 - 135 128 /* 136 129 * local_timer_interrupt() does profiling and process accounting 137 130 * on a per-CPU basis. ··· 159 158 * call the generic timer interrupt handling 160 159 */ 161 160 do_timer(1); 162 - 163 - /* 164 - * If we have an externally synchronized Linux clock, then update 165 - * CMOS clock accordingly every ~11 minutes. rtc_mips_set_time() has to be 166 - * called as close as possible to 500 ms before the new second starts. 167 - */ 168 - if (ntp_synced() && 169 - xtime.tv_sec > last_rtc_update + 660 && 170 - (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && 171 - (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { 172 - if (rtc_mips_set_mmss(xtime.tv_sec) == 0) { 173 - last_rtc_update = xtime.tv_sec; 174 - } else { 175 - /* do it again in 60 s */ 176 - last_rtc_update = xtime.tv_sec - 600; 177 - } 178 - } 179 161 180 162 write_sequnlock(&xtime_lock); 181 163
-18
arch/mips/sgi-ip27/ip27-timer.c
··· 40 40 #define TICK_SIZE (tick_nsec / 1000) 41 41 42 42 static unsigned long ct_cur[NR_CPUS]; /* What counter should be at next timer irq */ 43 - static long last_rtc_update; /* Last time the rtc clock got updated */ 44 43 45 44 #if 0 46 45 static int set_rtc_mmss(unsigned long nowtime) ··· 111 112 do_timer(1); 112 113 113 114 update_process_times(user_mode(get_irq_regs())); 114 - 115 - /* 116 - * If we have an externally synchronized Linux clock, then update 117 - * RTC clock accordingly every ~11 minutes. Set_rtc_mmss() has to be 118 - * called as close as possible to when a second starts. 119 - */ 120 - if (ntp_synced() && 121 - xtime.tv_sec > last_rtc_update + 660 && 122 - (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && 123 - (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) { 124 - if (rtc_mips_set_time(xtime.tv_sec) == 0) { 125 - last_rtc_update = xtime.tv_sec; 126 - } else { 127 - last_rtc_update = xtime.tv_sec - 600; 128 - /* do it again in 60 s */ 129 - } 130 - } 131 115 132 116 write_sequnlock(&xtime_lock); 133 117 irq_exit();