aboutsummaryrefslogtreecommitdiff
path: root/arch/parisc/kernel/time.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-29 11:30:45 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-29 11:30:45 -0700
commit4d3ce21fa9d2eaeda113aa2f9c2da80d972bef64 (patch)
tree9ffa5af467d6e9f6f6c8eb496489bf882613a459 /arch/parisc/kernel/time.c
parentb026188e8214ce87790730a56f3017d0bd222751 (diff)
parentc1a7a755be26f68d7f21ee769584149a96185ea8 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (23 commits) [PARISC] Move os_id_to_string() inside #ifndef __ASSEMBLY__ [PARISC] Fix do_gettimeofday() hang [PARISC] Fix PCREL22F relocation problem for most modules [PARISC] Refactor show_regs in traps.c [PARISC] Add os_id_to_string helper [PARISC] OS_ID_LINUX == 0x0006 [PARISC] Ensure Space ID hashing is turned off [PARISC] Match show_cache_info with reality [PARISC] Remove unused macro fixup_branch in syscall.S [PARISC] Add is_compat_task() helper [PARISC] Update Thibaut Varene's CREDITS entry [PARISC] Reduce data footprint in pdc_stable.c [PARISC] pdc_stable version 0.30 [PARISC] Work around machines which do not support chassis warnings [PARISC] PDC_CHASSIS is implemented on all machines [PARISC] Remove unconditional #define PIC in syscall macros [PARISC] Use MFIA in current_text_addr on pa2.0 processors [PARISC] Remove dead function pc_in_user_space [PARISC] Test ioc_needs_fdc variable instead of open coding [PARISC] Fix gcc 4.1 warnings in sba_iommu.c ...
Diffstat (limited to 'arch/parisc/kernel/time.c')
-rw-r--r--arch/parisc/kernel/time.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 594930bc4bc..eb35e1c0bb5 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -157,8 +157,22 @@ do_gettimeofday (struct timeval *tv)
usec += (xtime.tv_nsec / 1000);
} while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
- while (usec >= 1000000) {
- usec -= 1000000;
+ if (unlikely(usec > LONG_MAX)) {
+ /* This can happen if the gettimeoffset adjustment is
+ * negative and xtime.tv_nsec is smaller than the
+ * adjustment */
+ printk(KERN_ERR "do_gettimeofday() spurious xtime.tv_nsec of %ld\n", usec);
+ usec += USEC_PER_SEC;
+ --sec;
+ /* This should never happen, it means the negative
+ * time adjustment was more than a second, so there's
+ * something seriously wrong */
+ BUG_ON(usec > LONG_MAX);
+ }
+
+
+ while (usec >= USEC_PER_SEC) {
+ usec -= USEC_PER_SEC;
++sec;
}