diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-19 20:10:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-19 20:10:06 -0400 |
commit | 7d02093e29de9efc4a72d5e93baae9506969b789 (patch) | |
tree | a6fc2450132ae419934f6eb9d223baa338b7d782 /arch/frv/kernel | |
parent | 6e0b7b2c39b91b467270dd0bc383914f99e1fb28 (diff) | |
parent | e9ddbc075d95b2edf111247cdde16f33c31654a8 (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/frv/kernel')
-rw-r--r-- | arch/frv/kernel/time.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c index fb0ce7577225..0ddbbae83cb2 100644 --- a/arch/frv/kernel/time.c +++ b/arch/frv/kernel/time.c | |||
@@ -48,20 +48,12 @@ static struct irqaction timer_irq = { | |||
48 | .name = "timer", | 48 | .name = "timer", |
49 | }; | 49 | }; |
50 | 50 | ||
51 | static inline int set_rtc_mmss(unsigned long nowtime) | ||
52 | { | ||
53 | return -1; | ||
54 | } | ||
55 | |||
56 | /* | 51 | /* |
57 | * timer_interrupt() needs to keep up the real-time clock, | 52 | * timer_interrupt() needs to keep up the real-time clock, |
58 | * as well as call the "do_timer()" routine every clocktick | 53 | * as well as call the "do_timer()" routine every clocktick |
59 | */ | 54 | */ |
60 | static irqreturn_t timer_interrupt(int irq, void *dummy) | 55 | static irqreturn_t timer_interrupt(int irq, void *dummy) |
61 | { | 56 | { |
62 | /* last time the cmos clock got updated */ | ||
63 | static long last_rtc_update = 0; | ||
64 | |||
65 | profile_tick(CPU_PROFILING); | 57 | profile_tick(CPU_PROFILING); |
66 | /* | 58 | /* |
67 | * Here we are in the timer irq handler. We just have irqs locally | 59 | * Here we are in the timer irq handler. We just have irqs locally |
@@ -74,22 +66,6 @@ static irqreturn_t timer_interrupt(int irq, void *dummy) | |||
74 | 66 | ||
75 | do_timer(1); | 67 | do_timer(1); |
76 | 68 | ||
77 | /* | ||
78 | * If we have an externally synchronized Linux clock, then update | ||
79 | * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be | ||
80 | * called as close as possible to 500 ms before the new second starts. | ||
81 | */ | ||
82 | if (ntp_synced() && | ||
83 | xtime.tv_sec > last_rtc_update + 660 && | ||
84 | (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 && | ||
85 | (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2 | ||
86 | ) { | ||
87 | if (set_rtc_mmss(xtime.tv_sec) == 0) | ||
88 | last_rtc_update = xtime.tv_sec; | ||
89 | else | ||
90 | last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ | ||
91 | } | ||
92 | |||
93 | #ifdef CONFIG_HEARTBEAT | 69 | #ifdef CONFIG_HEARTBEAT |
94 | static unsigned short n; | 70 | static unsigned short n; |
95 | n++; | 71 | n++; |
@@ -119,7 +95,8 @@ void time_divisor_init(void) | |||
119 | __set_TCSR_DATA(0, base >> 8); | 95 | __set_TCSR_DATA(0, base >> 8); |
120 | } | 96 | } |
121 | 97 | ||
122 | void time_init(void) | 98 | |
99 | void read_persistent_clock(struct timespec *ts) | ||
123 | { | 100 | { |
124 | unsigned int year, mon, day, hour, min, sec; | 101 | unsigned int year, mon, day, hour, min, sec; |
125 | 102 | ||
@@ -135,9 +112,12 @@ void time_init(void) | |||
135 | 112 | ||
136 | if ((year += 1900) < 1970) | 113 | if ((year += 1900) < 1970) |
137 | year += 100; | 114 | year += 100; |
138 | xtime.tv_sec = mktime(year, mon, day, hour, min, sec); | 115 | ts->tv_sec = mktime(year, mon, day, hour, min, sec); |
139 | xtime.tv_nsec = 0; | 116 | ts->tv_nsec = 0; |
117 | } | ||
140 | 118 | ||
119 | void time_init(void) | ||
120 | { | ||
141 | /* install scheduling interrupt handler */ | 121 | /* install scheduling interrupt handler */ |
142 | setup_irq(IRQ_CPU_TIMER0, &timer_irq); | 122 | setup_irq(IRQ_CPU_TIMER0, &timer_irq); |
143 | 123 | ||