aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
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/alpha
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/alpha')
-rw-r--r--arch/alpha/kernel/time.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
index 7c1e44420a78..581ddcc22fc5 100644
--- a/arch/alpha/kernel/time.c
+++ b/arch/alpha/kernel/time.c
@@ -54,8 +54,6 @@
54#include "proto.h" 54#include "proto.h"
55#include "irq_impl.h" 55#include "irq_impl.h"
56 56
57extern unsigned long wall_jiffies; /* kernel/timer.c */
58
59static int set_rtc_mmss(unsigned long); 57static int set_rtc_mmss(unsigned long);
60 58
61DEFINE_SPINLOCK(rtc_lock); 59DEFINE_SPINLOCK(rtc_lock);
@@ -413,7 +411,7 @@ void
413do_gettimeofday(struct timeval *tv) 411do_gettimeofday(struct timeval *tv)
414{ 412{
415 unsigned long flags; 413 unsigned long flags;
416 unsigned long sec, usec, lost, seq; 414 unsigned long sec, usec, seq;
417 unsigned long delta_cycles, delta_usec, partial_tick; 415 unsigned long delta_cycles, delta_usec, partial_tick;
418 416
419 do { 417 do {
@@ -423,14 +421,13 @@ do_gettimeofday(struct timeval *tv)
423 sec = xtime.tv_sec; 421 sec = xtime.tv_sec;
424 usec = (xtime.tv_nsec / 1000); 422 usec = (xtime.tv_nsec / 1000);
425 partial_tick = state.partial_tick; 423 partial_tick = state.partial_tick;
426 lost = jiffies - wall_jiffies;
427 424
428 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 425 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
429 426
430#ifdef CONFIG_SMP 427#ifdef CONFIG_SMP
431 /* Until and unless we figure out how to get cpu cycle counters 428 /* Until and unless we figure out how to get cpu cycle counters
432 in sync and keep them there, we can't use the rpcc tricks. */ 429 in sync and keep them there, we can't use the rpcc tricks. */
433 delta_usec = lost * (1000000 / HZ); 430 delta_usec = 0;
434#else 431#else
435 /* 432 /*
436 * usec = cycles * ticks_per_cycle * 2**48 * 1e6 / (2**48 * ticks) 433 * usec = cycles * ticks_per_cycle * 2**48 * 1e6 / (2**48 * ticks)
@@ -446,8 +443,7 @@ do_gettimeofday(struct timeval *tv)
446 */ 443 */
447 444
448 delta_usec = (delta_cycles * state.scaled_ticks_per_cycle 445 delta_usec = (delta_cycles * state.scaled_ticks_per_cycle
449 + partial_tick 446 + partial_tick) * 15625;
450 + (lost << FIX_SHIFT)) * 15625;
451 delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2; 447 delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2;
452#endif 448#endif
453 449
@@ -480,12 +476,11 @@ do_settimeofday(struct timespec *tv)
480 time. Without this, a full-tick error is possible. */ 476 time. Without this, a full-tick error is possible. */
481 477
482#ifdef CONFIG_SMP 478#ifdef CONFIG_SMP
483 delta_nsec = (jiffies - wall_jiffies) * (NSEC_PER_SEC / HZ); 479 delta_nsec = 0;
484#else 480#else
485 delta_nsec = rpcc() - state.last_time; 481 delta_nsec = rpcc() - state.last_time;
486 delta_nsec = (delta_nsec * state.scaled_ticks_per_cycle 482 delta_nsec = (delta_nsec * state.scaled_ticks_per_cycle
487 + state.partial_tick 483 + state.partial_tick) * 15625;
488 + ((jiffies - wall_jiffies) << FIX_SHIFT)) * 15625;
489 delta_nsec = ((delta_nsec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2; 484 delta_nsec = ((delta_nsec / ((1UL << (FIX_SHIFT-6-1)) * HZ)) + 1) / 2;
490 delta_nsec *= 1000; 485 delta_nsec *= 1000;
491#endif 486#endif