aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 12:15:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-18 12:15:24 -0400
commita03fdb7612874834d6847107198712d18b5242c7 (patch)
tree9ae81170509fd8b1c23d1b7e8edfa7a2203ffce3 /arch/s390
parent202c4675c55ddf6b443c7e057d2dff6b42ef71aa (diff)
parent12e09337fe238981cb0c87543306e23775d1a143 (diff)
Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (34 commits) time: Prevent 32 bit overflow with set_normalized_timespec() clocksource: Delay clocksource down rating to late boot clocksource: clocksource_select must be called with mutex locked clocksource: Resolve cpu hotplug dead lock with TSC unstable, fix crash timers: Drop a function prototype clocksource: Resolve cpu hotplug dead lock with TSC unstable timer.c: Fix S/390 comments timekeeping: Fix invalid getboottime() value timekeeping: Fix up read_persistent_clock() breakage on sh timekeeping: Increase granularity of read_persistent_clock(), build fix time: Introduce CLOCK_REALTIME_COARSE x86: Do not unregister PIT clocksource on PIT oneshot setup/shutdown clocksource: Avoid clocksource watchdog circular locking dependency clocksource: Protect the watchdog rating changes with clocksource_mutex clocksource: Call clocksource_change_rating() outside of watchdog_lock timekeeping: Introduce read_boot_clock timekeeping: Increase granularity of read_persistent_clock() timekeeping: Update clocksource with stop_machine timekeeping: Add timekeeper read_clock helper functions timekeeping: Move NTP adjusted clock multiplier to struct timekeeper ... Fix trivial conflict due to MIPS lemote -> loongson renaming.
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/time.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index e3dc28b8075d..34162a0b2caa 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -184,12 +184,14 @@ static void timing_alert_interrupt(__u16 code)
184static void etr_reset(void); 184static void etr_reset(void);
185static void stp_reset(void); 185static void stp_reset(void);
186 186
187unsigned long read_persistent_clock(void) 187void read_persistent_clock(struct timespec *ts)
188{ 188{
189 struct timespec ts; 189 tod_to_timeval(get_clock() - TOD_UNIX_EPOCH, ts);
190}
190 191
191 tod_to_timeval(get_clock() - TOD_UNIX_EPOCH, &ts); 192void read_boot_clock(struct timespec *ts)
192 return ts.tv_sec; 193{
194 tod_to_timeval(sched_clock_base_cc - TOD_UNIX_EPOCH, ts);
193} 195}
194 196
195static cycle_t read_tod_clock(struct clocksource *cs) 197static cycle_t read_tod_clock(struct clocksource *cs)
@@ -207,6 +209,10 @@ static struct clocksource clocksource_tod = {
207 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 209 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
208}; 210};
209 211
212struct clocksource * __init clocksource_default_clock(void)
213{
214 return &clocksource_tod;
215}
210 216
211void update_vsyscall(struct timespec *wall_time, struct clocksource *clock) 217void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
212{ 218{
@@ -244,10 +250,6 @@ void update_vsyscall_tz(void)
244 */ 250 */
245void __init time_init(void) 251void __init time_init(void)
246{ 252{
247 struct timespec ts;
248 unsigned long flags;
249 cycle_t now;
250
251 /* Reset time synchronization interfaces. */ 253 /* Reset time synchronization interfaces. */
252 etr_reset(); 254 etr_reset();
253 stp_reset(); 255 stp_reset();
@@ -263,26 +265,6 @@ void __init time_init(void)
263 if (clocksource_register(&clocksource_tod) != 0) 265 if (clocksource_register(&clocksource_tod) != 0)
264 panic("Could not register TOD clock source"); 266 panic("Could not register TOD clock source");
265 267
266 /*
267 * The TOD clock is an accurate clock. The xtime should be
268 * initialized in a way that the difference between TOD and
269 * xtime is reasonably small. Too bad that timekeeping_init
270 * sets xtime.tv_nsec to zero. In addition the clock source
271 * change from the jiffies clock source to the TOD clock
272 * source add another error of up to 1/HZ second. The same
273 * function sets wall_to_monotonic to a value that is too
274 * small for /proc/uptime to be accurate.
275 * Reset xtime and wall_to_monotonic to sane values.
276 */
277 write_seqlock_irqsave(&xtime_lock, flags);
278 now = get_clock();
279 tod_to_timeval(now - TOD_UNIX_EPOCH, &xtime);
280 clocksource_tod.cycle_last = now;
281 clocksource_tod.raw_time = xtime;
282 tod_to_timeval(sched_clock_base_cc - TOD_UNIX_EPOCH, &ts);
283 set_normalized_timespec(&wall_to_monotonic, -ts.tv_sec, -ts.tv_nsec);
284 write_sequnlock_irqrestore(&xtime_lock, flags);
285
286 /* Enable TOD clock interrupts on the boot cpu. */ 268 /* Enable TOD clock interrupts on the boot cpu. */
287 init_cpu_timer(); 269 init_cpu_timer();
288 270