linux-mips
[Top] [All Lists]

[PATCH 2.6] vr41xx: fixed gettimeoffset

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 2.6] vr41xx: fixed gettimeoffset
From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Date: Mon, 10 Jan 2005 23:25:13 +0900
Cc: yuasa@hh.iij4u.or.jp, linux-mips <linux-mips@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hi Ralf,

My vr41xx gettimeoffset is wrong.
This patch changes vr41xx gettimeoffset to fixed rate gettimeoffset.

Please apply this patch to v2.6.

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff a-orig/arch/mips/vr41xx/common/rtc.c 
a/arch/mips/vr41xx/common/rtc.c
--- a-orig/arch/mips/vr41xx/common/rtc.c        Thu May 27 02:11:11 2004
+++ a/arch/mips/vr41xx/common/rtc.c     Mon Jan 10 22:30:21 2005
@@ -1,7 +1,7 @@
 /*
  *  rtc.c, RTC(has only timer function) routines for NEC VR4100 series.
  *
- *  Copyright (C) 2003-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+ *  Copyright (C) 2003-2005  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -188,7 +188,7 @@
 
        if (cycles_per_sec >= CLOCK_TICK_RATE) {
                cycles_per_sec = 0;
-               remainder_per_sec = REMAINDER_PER_SEC;
+               remainder_per_sec += REMAINDER_PER_SEC;
        }
 
        cycles_per_jiffy = 0;
@@ -219,18 +219,6 @@
        return (unsigned int)cur;
 }
 
-static unsigned long vr41xx_gettimeoffset(void)
-{
-       uint64_t cur;
-       unsigned long gap;
-
-       cur = read_elapsedtime_counter();
-       gap = (unsigned long)(cur - previous_elapsedtime);
-       gap = gap / CYCLES_PER_100USEC * 100;   /* usec */
-
-       return gap;
-}
-
 static unsigned long vr41xx_get_time(void)
 {
        uint64_t counts;
@@ -293,8 +281,6 @@
 
 static void __init vr41xx_timer_setup(struct irqaction *irq)
 {
-       do_gettimeoffset = vr41xx_gettimeoffset;
-
        remainder_per_sec = REMAINDER_PER_SEC;
        cycles_per_jiffy = CYCLES_PER_JIFFY;
 

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 2.6] vr41xx: fixed gettimeoffset, Yoichi Yuasa <=