提交 8f80e5c9 编写于 作者: S Stephen Rothwell 提交者: Linus Torvalds

[PATCH] ppc64: fix initialisation of gettimeofday calculations

On PPC64, we keep track of when we need to update jiffies (and the
variables used to calculate the time of day) based on the time base.

If the time base frequence is sufficiently high compared to the
processor clock frequency, then it is possible for the time of day
variables to be corrupted at the time of the first decrementer interrupt
we take.  This became obvious on a legacy iSeries where the time base
frequency is the same as the processor clock.

This one line patch fixes the initialisation so that the time of day
variables and the indicator we use to tell when updates are due are
better synchronised.
Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 2a24ab62
......@@ -515,6 +515,7 @@ void __init time_init(void)
do_gtod.varp = &do_gtod.vars[0];
do_gtod.var_idx = 0;
do_gtod.varp->tb_orig_stamp = tb_last_stamp;
get_paca()->next_jiffy_update_tb = tb_last_stamp + tb_ticks_per_jiffy;
do_gtod.varp->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC;
do_gtod.tb_ticks_per_sec = tb_ticks_per_sec;
do_gtod.varp->tb_to_xs = tb_to_xs;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册