aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/time.c')
-rw-r--r--arch/powerpc/kernel/time.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 260b6ecd26a9..070b4b458aaf 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -62,8 +62,8 @@
62#include <asm/irq.h> 62#include <asm/irq.h>
63#include <asm/div64.h> 63#include <asm/div64.h>
64#include <asm/smp.h> 64#include <asm/smp.h>
65#include <asm/vdso_datapage.h>
65#ifdef CONFIG_PPC64 66#ifdef CONFIG_PPC64
66#include <asm/systemcfg.h>
67#include <asm/firmware.h> 67#include <asm/firmware.h>
68#endif 68#endif
69#ifdef CONFIG_PPC_ISERIES 69#ifdef CONFIG_PPC_ISERIES
@@ -261,7 +261,6 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
261 do_gtod.varp = temp_varp; 261 do_gtod.varp = temp_varp;
262 do_gtod.var_idx = temp_idx; 262 do_gtod.var_idx = temp_idx;
263 263
264#ifdef CONFIG_PPC64
265 /* 264 /*
266 * tb_update_count is used to allow the userspace gettimeofday code 265 * tb_update_count is used to allow the userspace gettimeofday code
267 * to assure itself that it sees a consistent view of the tb_to_xs and 266 * to assure itself that it sees a consistent view of the tb_to_xs and
@@ -271,14 +270,15 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
271 * tb_to_xs and stamp_xsec values are consistent. If not, then it 270 * tb_to_xs and stamp_xsec values are consistent. If not, then it
272 * loops back and reads them again until this criteria is met. 271 * loops back and reads them again until this criteria is met.
273 */ 272 */
274 ++(_systemcfg->tb_update_count); 273 ++(vdso_data->tb_update_count);
275 smp_wmb(); 274 smp_wmb();
276 _systemcfg->tb_orig_stamp = new_tb_stamp; 275 vdso_data->tb_orig_stamp = new_tb_stamp;
277 _systemcfg->stamp_xsec = new_stamp_xsec; 276 vdso_data->stamp_xsec = new_stamp_xsec;
278 _systemcfg->tb_to_xs = new_tb_to_xs; 277 vdso_data->tb_to_xs = new_tb_to_xs;
278 vdso_data->wtom_clock_sec = wall_to_monotonic.tv_sec;
279 vdso_data->wtom_clock_nsec = wall_to_monotonic.tv_nsec;
279 smp_wmb(); 280 smp_wmb();
280 ++(_systemcfg->tb_update_count); 281 ++(vdso_data->tb_update_count);
281#endif
282} 282}
283 283
284/* 284/*
@@ -357,9 +357,8 @@ static void iSeries_tb_recal(void)
357 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 357 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
358 tb_to_xs = divres.result_low; 358 tb_to_xs = divres.result_low;
359 do_gtod.varp->tb_to_xs = tb_to_xs; 359 do_gtod.varp->tb_to_xs = tb_to_xs;
360 _systemcfg->tb_ticks_per_sec = 360 vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
361 tb_ticks_per_sec; 361 vdso_data->tb_to_xs = tb_to_xs;
362 _systemcfg->tb_to_xs = tb_to_xs;
363 } 362 }
364 else { 363 else {
365 printk( "Titan recalibrate: FAILED (difference > 4 percent)\n" 364 printk( "Titan recalibrate: FAILED (difference > 4 percent)\n"
@@ -561,10 +560,8 @@ int do_settimeofday(struct timespec *tv)
561 new_xsec += (u64)new_sec * XSEC_PER_SEC - tb_delta_xs; 560 new_xsec += (u64)new_sec * XSEC_PER_SEC - tb_delta_xs;
562 update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs); 561 update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs);
563 562
564#ifdef CONFIG_PPC64 563 vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
565 _systemcfg->tz_minuteswest = sys_tz.tz_minuteswest; 564 vdso_data->tz_dsttime = sys_tz.tz_dsttime;
566 _systemcfg->tz_dsttime = sys_tz.tz_dsttime;
567#endif
568 565
569 write_sequnlock_irqrestore(&xtime_lock, flags); 566 write_sequnlock_irqrestore(&xtime_lock, flags);
570 clock_was_set(); 567 clock_was_set();
@@ -713,13 +710,12 @@ void __init time_init(void)
713 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 710 do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
714 do_gtod.varp->tb_to_xs = tb_to_xs; 711 do_gtod.varp->tb_to_xs = tb_to_xs;
715 do_gtod.tb_to_us = tb_to_us; 712 do_gtod.tb_to_us = tb_to_us;
716#ifdef CONFIG_PPC64 713
717 _systemcfg->tb_orig_stamp = tb_last_jiffy; 714 vdso_data->tb_orig_stamp = tb_last_jiffy;
718 _systemcfg->tb_update_count = 0; 715 vdso_data->tb_update_count = 0;
719 _systemcfg->tb_ticks_per_sec = tb_ticks_per_sec; 716 vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
720 _systemcfg->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; 717 vdso_data->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC;
721 _systemcfg->tb_to_xs = tb_to_xs; 718 vdso_data->tb_to_xs = tb_to_xs;
722#endif
723 719
724 time_freq = 0; 720 time_freq = 0;
725 721