aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/kernel
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/m68k/kernel
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/m68k/kernel')
-rw-r--r--arch/m68k/kernel/time.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index 1072e4946a4a..6cfc984380d9 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -96,31 +96,23 @@ void time_init(void)
96void do_gettimeofday(struct timeval *tv) 96void do_gettimeofday(struct timeval *tv)
97{ 97{
98 unsigned long flags; 98 unsigned long flags;
99 extern unsigned long wall_jiffies;
100 unsigned long seq; 99 unsigned long seq;
101 unsigned long usec, sec, lost; 100 unsigned long usec, sec;
102 unsigned long max_ntp_tick = tick_usec - tickadj; 101 unsigned long max_ntp_tick = tick_usec - tickadj;
103 102
104 do { 103 do {
105 seq = read_seqbegin_irqsave(&xtime_lock, flags); 104 seq = read_seqbegin_irqsave(&xtime_lock, flags);
106 105
107 usec = mach_gettimeoffset(); 106 usec = mach_gettimeoffset();
108 lost = jiffies - wall_jiffies;
109 107
110 /* 108 /*
111 * If time_adjust is negative then NTP is slowing the clock 109 * If time_adjust is negative then NTP is slowing the clock
112 * so make sure not to go into next possible interval. 110 * so make sure not to go into next possible interval.
113 * Better to lose some accuracy than have time go backwards.. 111 * Better to lose some accuracy than have time go backwards..
114 */ 112 */
115 if (unlikely(time_adjust < 0)) { 113 if (unlikely(time_adjust < 0))
116 usec = min(usec, max_ntp_tick); 114 usec = min(usec, max_ntp_tick);
117 115
118 if (lost)
119 usec += lost * max_ntp_tick;
120 }
121 else if (unlikely(lost))
122 usec += lost * tick_usec;
123
124 sec = xtime.tv_sec; 116 sec = xtime.tv_sec;
125 usec += xtime.tv_nsec/1000; 117 usec += xtime.tv_nsec/1000;
126 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 118 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
@@ -141,7 +133,6 @@ int do_settimeofday(struct timespec *tv)
141{ 133{
142 time_t wtm_sec, sec = tv->tv_sec; 134 time_t wtm_sec, sec = tv->tv_sec;
143 long wtm_nsec, nsec = tv->tv_nsec; 135 long wtm_nsec, nsec = tv->tv_nsec;
144 extern unsigned long wall_jiffies;
145 136
146 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) 137 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
147 return -EINVAL; 138 return -EINVAL;
@@ -153,8 +144,7 @@ int do_settimeofday(struct timespec *tv)
153 * Discover what correction gettimeofday 144 * Discover what correction gettimeofday
154 * would have done, and then undo it! 145 * would have done, and then undo it!
155 */ 146 */
156 nsec -= 1000 * (mach_gettimeoffset() + 147 nsec -= 1000 * mach_gettimeoffset();
157 (jiffies - wall_jiffies) * (1000000 / HZ));
158 148
159 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); 149 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
160 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); 150 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);