Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3392b309dbd1f1f37454c412c2045448300cf374
Commit:     3392b309dbd1f1f37454c412c2045448300cf374
Parent:     127a7ec69c9ce17a5add2e3c8c2f1a2733fb88d8
Author:     Andrew Victor <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 8 11:04:19 2007 +0100
Committer:  Russell King <[EMAIL PROTECTED]>
CommitDate: Thu Feb 8 14:55:29 2007 +0000

    [ARM] 4149/1: AT91: Overrun in SAM9 gettimeoffset().
    
    Fix an overrun in the AT91SAM9 gettimeoffset() function.  This causes
    the time value returned by gettimeofday() to jump "backwards".
    
    Original patch from Michel Benoit.
    
    Signed-off-by: Andrew Victor <[EMAIL PROTECTED]>
    Signed-off-by: Russell King <[EMAIL PROTECTED]>
---
 arch/arm/mach-at91/at91sam926x_time.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam926x_time.c 
b/arch/arm/mach-at91/at91sam926x_time.c
index 59cbbe1..a4dded2 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -30,7 +30,6 @@
  * Returns number of microseconds since last timer interrupt.  Note that 
interrupts
  * will have been disabled by do_gettimeofday()
  *  'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy.
- *  'tick' is usecs per jiffy (linux/timex.h).
  */
 static unsigned long at91sam926x_gettimeoffset(void)
 {
@@ -39,7 +38,7 @@ static unsigned long at91sam926x_gettimeoffset(void)
 
        elapsed = (PIT_PICNT(t) * LATCH) + PIT_CPIV(t);         /* hardware 
clock cycles */
 
-       return (unsigned long)(elapsed * 1000000) / LATCH;
+       return (unsigned long)(elapsed * jiffies_to_usecs(1)) / LATCH;
 }
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to