diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-10-01 02:28:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:27 -0400 |
commit | 8ef386092d7c2891bd7acefb2a87f878f7e9a0d6 (patch) | |
tree | b149f0c63f9b9bb3f43e82097f1ae5972662288f /arch/sparc/kernel | |
parent | 70bc42f90a3f4721c89dbe865e6c95da8565b41c (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/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/pcic.c | 16 | ||||
-rw-r--r-- | arch/sparc/kernel/time.c | 18 |
2 files changed, 5 insertions, 29 deletions
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index e19b1bad9bc5..edb6cc665f56 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -765,8 +765,6 @@ static __inline__ unsigned long do_gettimeoffset(void) | |||
765 | return count; | 765 | return count; |
766 | } | 766 | } |
767 | 767 | ||
768 | extern unsigned long wall_jiffies; | ||
769 | |||
770 | static void pci_do_gettimeofday(struct timeval *tv) | 768 | static void pci_do_gettimeofday(struct timeval *tv) |
771 | { | 769 | { |
772 | unsigned long flags; | 770 | unsigned long flags; |
@@ -775,26 +773,17 @@ static void pci_do_gettimeofday(struct timeval *tv) | |||
775 | unsigned long max_ntp_tick = tick_usec - tickadj; | 773 | unsigned long max_ntp_tick = tick_usec - tickadj; |
776 | 774 | ||
777 | do { | 775 | do { |
778 | unsigned long lost; | ||
779 | |||
780 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | 776 | seq = read_seqbegin_irqsave(&xtime_lock, flags); |
781 | usec = do_gettimeoffset(); | 777 | usec = do_gettimeoffset(); |
782 | lost = jiffies - wall_jiffies; | ||
783 | 778 | ||
784 | /* | 779 | /* |
785 | * If time_adjust is negative then NTP is slowing the clock | 780 | * If time_adjust is negative then NTP is slowing the clock |
786 | * so make sure not to go into next possible interval. | 781 | * so make sure not to go into next possible interval. |
787 | * Better to lose some accuracy than have time go backwards.. | 782 | * Better to lose some accuracy than have time go backwards.. |
788 | */ | 783 | */ |
789 | if (unlikely(time_adjust < 0)) { | 784 | if (unlikely(time_adjust < 0)) |
790 | usec = min(usec, max_ntp_tick); | 785 | usec = min(usec, max_ntp_tick); |
791 | 786 | ||
792 | if (lost) | ||
793 | usec += lost * max_ntp_tick; | ||
794 | } | ||
795 | else if (unlikely(lost)) | ||
796 | usec += lost * tick_usec; | ||
797 | |||
798 | sec = xtime.tv_sec; | 787 | sec = xtime.tv_sec; |
799 | usec += (xtime.tv_nsec / 1000); | 788 | usec += (xtime.tv_nsec / 1000); |
800 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | 789 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); |
@@ -819,8 +808,7 @@ static int pci_do_settimeofday(struct timespec *tv) | |||
819 | * wall time. Discover what correction gettimeofday() would have | 808 | * wall time. Discover what correction gettimeofday() would have |
820 | * made, and then undo it! | 809 | * made, and then undo it! |
821 | */ | 810 | */ |
822 | tv->tv_nsec -= 1000 * (do_gettimeoffset() + | 811 | tv->tv_nsec -= 1000 * do_gettimeoffset(); |
823 | (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ)); | ||
824 | while (tv->tv_nsec < 0) { | 812 | while (tv->tv_nsec < 0) { |
825 | tv->tv_nsec += NSEC_PER_SEC; | 813 | tv->tv_nsec += NSEC_PER_SEC; |
826 | tv->tv_sec--; | 814 | tv->tv_sec--; |
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index 6f84fa1b58e5..e10dc831944d 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c | |||
@@ -43,8 +43,6 @@ | |||
43 | #include <asm/pcic.h> | 43 | #include <asm/pcic.h> |
44 | #include <asm/of_device.h> | 44 | #include <asm/of_device.h> |
45 | 45 | ||
46 | extern unsigned long wall_jiffies; | ||
47 | |||
48 | DEFINE_SPINLOCK(rtc_lock); | 46 | DEFINE_SPINLOCK(rtc_lock); |
49 | enum sparc_clock_type sp_clock_typ; | 47 | enum sparc_clock_type sp_clock_typ; |
50 | DEFINE_SPINLOCK(mostek_lock); | 48 | DEFINE_SPINLOCK(mostek_lock); |
@@ -449,7 +447,7 @@ unsigned long long sched_clock(void) | |||
449 | 447 | ||
450 | /* Ok, my cute asm atomicity trick doesn't work anymore. | 448 | /* Ok, my cute asm atomicity trick doesn't work anymore. |
451 | * There are just too many variables that need to be protected | 449 | * There are just too many variables that need to be protected |
452 | * now (both members of xtime, wall_jiffies, et al.) | 450 | * now (both members of xtime, et al.) |
453 | */ | 451 | */ |
454 | void do_gettimeofday(struct timeval *tv) | 452 | void do_gettimeofday(struct timeval *tv) |
455 | { | 453 | { |
@@ -459,26 +457,17 @@ void do_gettimeofday(struct timeval *tv) | |||
459 | unsigned long max_ntp_tick = tick_usec - tickadj; | 457 | unsigned long max_ntp_tick = tick_usec - tickadj; |
460 | 458 | ||
461 | do { | 459 | do { |
462 | unsigned long lost; | ||
463 | |||
464 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | 460 | seq = read_seqbegin_irqsave(&xtime_lock, flags); |
465 | usec = do_gettimeoffset(); | 461 | usec = do_gettimeoffset(); |
466 | lost = jiffies - wall_jiffies; | ||
467 | 462 | ||
468 | /* | 463 | /* |
469 | * If time_adjust is negative then NTP is slowing the clock | 464 | * If time_adjust is negative then NTP is slowing the clock |
470 | * so make sure not to go into next possible interval. | 465 | * so make sure not to go into next possible interval. |
471 | * Better to lose some accuracy than have time go backwards.. | 466 | * Better to lose some accuracy than have time go backwards.. |
472 | */ | 467 | */ |
473 | if (unlikely(time_adjust < 0)) { | 468 | if (unlikely(time_adjust < 0)) |
474 | usec = min(usec, max_ntp_tick); | 469 | usec = min(usec, max_ntp_tick); |
475 | 470 | ||
476 | if (lost) | ||
477 | usec += lost * max_ntp_tick; | ||
478 | } | ||
479 | else if (unlikely(lost)) | ||
480 | usec += lost * tick_usec; | ||
481 | |||
482 | sec = xtime.tv_sec; | 471 | sec = xtime.tv_sec; |
483 | usec += (xtime.tv_nsec / 1000); | 472 | usec += (xtime.tv_nsec / 1000); |
484 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | 473 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); |
@@ -521,8 +510,7 @@ static int sbus_do_settimeofday(struct timespec *tv) | |||
521 | * wall time. Discover what correction gettimeofday() would have | 510 | * wall time. Discover what correction gettimeofday() would have |
522 | * made, and then undo it! | 511 | * made, and then undo it! |
523 | */ | 512 | */ |
524 | nsec -= 1000 * (do_gettimeoffset() + | 513 | nsec -= 1000 * do_gettimeoffset(); |
525 | (jiffies - wall_jiffies) * (USEC_PER_SEC / HZ)); | ||
526 | 514 | ||
527 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); | 515 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); |
528 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); | 516 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); |