aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-19 20:10:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-19 20:10:06 -0400
commit7d02093e29de9efc4a72d5e93baae9506969b789 (patch)
treea6fc2450132ae419934f6eb9d223baa338b7d782 /arch/sparc
parent6e0b7b2c39b91b467270dd0bc383914f99e1fb28 (diff)
parente9ddbc075d95b2edf111247cdde16f33c31654a8 (diff)
Merge branch 'timers-for-linus-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-for-linus-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: avr32: Fix typo in read_persistent_clock() sparc: Convert sparc to use read/update_persistent_clock cris: Convert cris to use read/update_persistent_clock m68k: Convert m68k to use read/update_persistent_clock m32r: Convert m32r to use read/update_peristent_clock blackfin: Convert blackfin to use read/update_persistent_clock ia64: Convert ia64 to use read/update_persistent_clock avr32: Convert avr32 to use read/update_persistent_clock h8300: Convert h8300 to use read/update_persistent_clock frv: Convert frv to use read/update_persistent_clock mn10300: Convert mn10300 to use read/update_persistent_clock alpha: Convert alpha to use read/update_persistent_clock xtensa: Fix unnecessary setting of xtime time: Clean up direct xtime usage in xen
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/Kconfig2
-rw-r--r--arch/sparc/kernel/time_32.c18
2 files changed, 6 insertions, 14 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 9908d477ccd9..d6781ce687e2 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -75,7 +75,7 @@ config ARCH_USES_GETTIMEOFFSET
75 75
76config GENERIC_CMOS_UPDATE 76config GENERIC_CMOS_UPDATE
77 bool 77 bool
78 default y if SPARC64 78 default y
79 79
80config GENERIC_CLOCKEVENTS 80config GENERIC_CLOCKEVENTS
81 bool 81 bool
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 0d4c09b15efc..4453003032b5 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -78,6 +78,11 @@ __volatile__ unsigned int *master_l10_counter;
78 78
79u32 (*do_arch_gettimeoffset)(void); 79u32 (*do_arch_gettimeoffset)(void);
80 80
81int update_persistent_clock(struct timespec now)
82{
83 return set_rtc_mmss(now.tv_sec);
84}
85
81/* 86/*
82 * timer_interrupt() needs to keep up the real-time clock, 87 * timer_interrupt() needs to keep up the real-time clock,
83 * as well as call the "do_timer()" routine every clocktick 88 * as well as call the "do_timer()" routine every clocktick
@@ -87,9 +92,6 @@ u32 (*do_arch_gettimeoffset)(void);
87 92
88static irqreturn_t timer_interrupt(int dummy, void *dev_id) 93static irqreturn_t timer_interrupt(int dummy, void *dev_id)
89{ 94{
90 /* last time the cmos clock got updated */
91 static long last_rtc_update;
92
93#ifndef CONFIG_SMP 95#ifndef CONFIG_SMP
94 profile_tick(CPU_PROFILING); 96 profile_tick(CPU_PROFILING);
95#endif 97#endif
@@ -101,16 +103,6 @@ static irqreturn_t timer_interrupt(int dummy, void *dev_id)
101 103
102 do_timer(1); 104 do_timer(1);
103 105
104 /* Determine when to update the Mostek clock. */
105 if (ntp_synced() &&
106 xtime.tv_sec > last_rtc_update + 660 &&
107 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
108 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
109 if (set_rtc_mmss(xtime.tv_sec) == 0)
110 last_rtc_update = xtime.tv_sec;
111 else
112 last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
113 }
114 write_sequnlock(&xtime_lock); 106 write_sequnlock(&xtime_lock);
115 107
116#ifndef CONFIG_SMP 108#ifndef CONFIG_SMP