From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: linux-mips@linux-mips.org
Cc: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 1/5] Use generic NTP code for all MIPS platforms
Date: Thu, 14 Jun 2007 12:19:57 +0200 [thread overview]
Message-ID: <11818164021503-git-send-email-fbuihuu@gmail.com> (raw)
In-Reply-To: <11818164011355-git-send-email-fbuihuu@gmail.com>
From: Ralf Baechle <ralf@linux-mips.org>
---
arch/mips/Kconfig | 4 ++++
arch/mips/kernel/time.c | 24 ++++--------------------
arch/mips/sgi-ip27/ip27-timer.c | 18 ------------------
3 files changed, 8 insertions(+), 38 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index da253bc..7bcf38d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -723,6 +723,10 @@ config GENERIC_TIME
bool
default y
+config GENERIC_CMOS_UPDATE
+ bool
+ default y
+
config SCHED_NO_NO_OMIT_FRAME_POINTER
bool
default y
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 7def1ff..376e127 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -66,6 +66,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;
@@ -124,9 +128,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.
@@ -158,23 +159,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);
/*
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 8c3c78c..3134616 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -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)
@@ -113,23 +112,6 @@ again:
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();
}
--
1.5.2.1
next prev parent reply other threads:[~2007-06-14 10:20 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-14 10:19 [RFD] Time rework [take #2] Franck Bui-Huu
2007-06-14 10:19 ` Franck Bui-Huu [this message]
2007-06-14 10:19 ` [PATCH 2/5] Remove unused time.c for swarm Franck Bui-Huu
2007-06-14 10:19 ` [PATCH 3/5] Deforest the function pointer jungle in the time code Franck Bui-Huu
2007-06-14 11:17 ` Thomas Bogendoerfer
2007-06-14 13:43 ` Franck Bui-Huu
2007-06-14 14:09 ` Maciej W. Rozycki
2007-06-14 14:31 ` Franck Bui-Huu
2007-06-14 16:33 ` Maciej W. Rozycki
2007-06-14 16:54 ` Maciej W. Rozycki
2007-06-15 8:59 ` Franck Bui-Huu
2007-06-15 11:07 ` Maciej W. Rozycki
2007-06-15 13:26 ` Ralf Baechle
2007-06-15 14:08 ` Maciej W. Rozycki
2007-06-15 14:21 ` Ralf Baechle
2007-06-15 14:24 ` Franck Bui-Huu
2007-06-15 14:38 ` Ralf Baechle
2007-06-15 15:34 ` Franck Bui-Huu
2007-06-15 14:35 ` Sergei Shtylyov
2007-06-15 13:49 ` Ralf Baechle
2007-06-15 14:42 ` Sergei Shtylyov
2007-06-17 13:36 ` Franck Bui-Huu
2007-06-17 16:14 ` Atsushi Nemoto
2007-06-18 9:38 ` Franck Bui-Huu
2007-06-18 15:51 ` Atsushi Nemoto
2007-06-19 7:33 ` Franck Bui-Huu
2007-06-19 16:08 ` Atsushi Nemoto
2007-06-19 16:22 ` Sergei Shtylyov
2007-06-19 16:55 ` Franck Bui-Huu
2007-06-19 21:58 ` Ralf Baechle
2007-06-20 10:27 ` Franck Bui-Huu
2007-06-19 17:00 ` Franck Bui-Huu
2007-06-19 17:26 ` Sergei Shtylyov
2007-06-19 17:31 ` Sergei Shtylyov
2007-06-19 19:34 ` Sergei Shtylyov
2007-06-18 12:41 ` Franck Bui-Huu
2007-06-19 19:25 ` Sergei Shtylyov
2007-06-20 10:24 ` Franck Bui-Huu
2007-06-14 15:52 ` Franck Bui-Huu
2007-06-14 16:45 ` Maciej W. Rozycki
2007-06-14 10:20 ` [PATCH 4/5] Consolidate all variants of MIPS cp0 timer interrupt handlers Franck Bui-Huu
2007-06-14 10:20 ` [PATCH 5/5] Implement clockevents for R4000-style cp0 timer Franck Bui-Huu
2007-06-14 12:29 ` Atsushi Nemoto
2007-06-14 13:00 ` Franck Bui-Huu
2007-06-17 0:04 ` Ralf Baechle
2007-06-17 17:23 ` Atsushi Nemoto
2007-06-17 19:25 ` Ralf Baechle
2007-06-18 14:22 ` Franck Bui-Huu
2007-06-18 15:14 ` Ralf Baechle
2007-06-18 15:38 ` Franck Bui-Huu
2007-06-18 15:55 ` Franck Bui-Huu
2007-06-18 16:01 ` Ralf Baechle
2007-06-18 17:42 ` Ralf Baechle
2007-06-18 15:37 ` Ralf Baechle
2007-06-19 17:00 ` Sergei Shtylyov
2007-06-20 8:15 ` Ralf Baechle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11818164021503-git-send-email-fbuihuu@gmail.com \
--to=vagabon.xyz@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.