aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/sys_ppc32.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-02-19 18:38:56 -0500
committerPaul Mackerras <paulus@samba.org>2006-02-19 18:38:56 -0500
commit092b8f3488a3e50a4ab5f2f3f7c8bbf56b3144e1 (patch)
treefe9aa2dc2de1ed23109ef77ce8bd38120c2d643d /arch/powerpc/kernel/sys_ppc32.c
parentbd71c2b17468a2531fb4c81ec1d73520845e97e1 (diff)
powerpc: Keep xtime and gettimeofday in sync
This fixes a regression which was introduced by moving ppc32 to use the same sort of lockless gettimeofday as ppc64 has been using for some time. This involves getting the timebase and performing some simple arithmetic to convert it to seconds and microseconds. However, the factor and offset used there weren't being updated when NTP varied the tick length using adjtimex. 64-bit didn't notice the problem because it had a hook in the 32-bit adjtimex compat routine that attempted to work out what the generic timekeeping code would do and alter the factor and offset to match. However, that code was very complex and it wasn't clear that it still matched what the generic code would do. Now we use the generic current_tick_length() routine that was recently added to check that the current tick will be as long as we expect; if not we recompute the factor and offset. This keeps gettimeofday and xtime in sync. In addition we check that gettimeofday hasn't got ahead of xtime on each timer interrupt; if it has, we resync. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/sys_ppc32.c')
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 475249dc2350..cd75ab2908fa 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -176,7 +176,6 @@ struct timex32 {
176}; 176};
177 177
178extern int do_adjtimex(struct timex *); 178extern int do_adjtimex(struct timex *);
179extern void ppc_adjtimex(void);
180 179
181asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp) 180asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp)
182{ 181{
@@ -209,9 +208,6 @@ asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp)
209 208
210 ret = do_adjtimex(&txc); 209 ret = do_adjtimex(&txc);
211 210
212 /* adjust the conversion of TB to time of day to track adjtimex */
213 ppc_adjtimex();
214
215 if(put_user(txc.modes, &utp->modes) || 211 if(put_user(txc.modes, &utp->modes) ||
216 __put_user(txc.offset, &utp->offset) || 212 __put_user(txc.offset, &utp->offset) ||
217 __put_user(txc.freq, &utp->freq) || 213 __put_user(txc.freq, &utp->freq) ||