aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/time.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-10-01 02:28:31 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:27 -0400
commit8ef386092d7c2891bd7acefb2a87f878f7e9a0d6 (patch)
treeb149f0c63f9b9bb3f43e82097f1ae5972662288f /arch/x86_64/kernel/time.c
parent70bc42f90a3f4721c89dbe865e6c95da8565b41c (diff)
[PATCH] kill wall_jiffies
With 2.6.18-rc4-mm2, now wall_jiffies will always be the same as jiffies. So we can kill wall_jiffies completely. This is just a cleanup and logically should not change any real behavior except for one thing: RTC updating code in (old) ppc and xtensa use a condition "jiffies - wall_jiffies == 1". This condition is never met so I suppose it is just a bug. I just remove that condition only instead of kill the whole "if" block. [heiko.carstens@de.ibm.com: s390 build fix and cleanup] Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Andi Kleen <ak@muc.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Ian Molton <spyro@f2s.com> Cc: Mikael Starvik <starvik@axis.com> Cc: David Howells <dhowells@redhat.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Hirokazu Takata <takata.hirokazu@renesas.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp> Cc: Richard Curnow <rc@rc0.org.uk> Cc: William Lee Irwin III <wli@holomorphy.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Miles Bader <uclinux-v850@lsi.nec.co.jp> Cc: Chris Zankel <chris@zankel.net> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/time.c')
-rw-r--r--arch/x86_64/kernel/time.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 7ea3bf2a858c..557e92af7bea 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -77,7 +77,6 @@ unsigned long long monotonic_base;
77struct vxtime_data __vxtime __section_vxtime; /* for vsyscalls */ 77struct vxtime_data __vxtime __section_vxtime; /* for vsyscalls */
78 78
79volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES; 79volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
80unsigned long __wall_jiffies __section_wall_jiffies = INITIAL_JIFFIES;
81struct timespec __xtime __section_xtime; 80struct timespec __xtime __section_xtime;
82struct timezone __sys_tz __section_sys_tz; 81struct timezone __sys_tz __section_sys_tz;
83 82
@@ -119,7 +118,7 @@ unsigned int (*do_gettimeoffset)(void) = do_gettimeoffset_tsc;
119 118
120void do_gettimeofday(struct timeval *tv) 119void do_gettimeofday(struct timeval *tv)
121{ 120{
122 unsigned long seq, t; 121 unsigned long seq;
123 unsigned int sec, usec; 122 unsigned int sec, usec;
124 123
125 do { 124 do {
@@ -136,10 +135,7 @@ void do_gettimeofday(struct timeval *tv)
136 be found. Note when you fix it here you need to do the same 135 be found. Note when you fix it here you need to do the same
137 in arch/x86_64/kernel/vsyscall.c and export all needed 136 in arch/x86_64/kernel/vsyscall.c and export all needed
138 variables in vmlinux.lds. -AK */ 137 variables in vmlinux.lds. -AK */
139 138 usec += do_gettimeoffset();
140 t = (jiffies - wall_jiffies) * USEC_PER_TICK +
141 do_gettimeoffset();
142 usec += t;
143 139
144 } while (read_seqretry(&xtime_lock, seq)); 140 } while (read_seqretry(&xtime_lock, seq));
145 141
@@ -165,8 +161,7 @@ int do_settimeofday(struct timespec *tv)
165 161
166 write_seqlock_irq(&xtime_lock); 162 write_seqlock_irq(&xtime_lock);
167 163
168 nsec -= do_gettimeoffset() * NSEC_PER_USEC + 164 nsec -= do_gettimeoffset() * NSEC_PER_USEC;
169 (jiffies - wall_jiffies) * NSEC_PER_TICK;
170 165
171 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); 166 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
172 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); 167 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
@@ -1071,7 +1066,6 @@ static int timer_resume(struct sys_device *dev)
1071 vxtime.last_tsc = get_cycles_sync(); 1066 vxtime.last_tsc = get_cycles_sync();
1072 write_sequnlock_irqrestore(&xtime_lock,flags); 1067 write_sequnlock_irqrestore(&xtime_lock,flags);
1073 jiffies += sleep_length; 1068 jiffies += sleep_length;
1074 wall_jiffies += sleep_length;
1075 monotonic_base += sleep_length * (NSEC_PER_SEC/HZ); 1069 monotonic_base += sleep_length * (NSEC_PER_SEC/HZ);
1076 touch_softlockup_watchdog(); 1070 touch_softlockup_watchdog();
1077 return 0; 1071 return 0;