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/pcic.c | |
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/pcic.c')
-rw-r--r-- | arch/sparc/kernel/pcic.c | 16 |
1 files changed, 2 insertions, 14 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--; |