linux-mips
[Top] [All Lists]

Re: [MIPS] Fix and cleanup the MIPS part of the (ab)use of CLOCK_TICK_RA

To: linux-mips@linux-mips.org
Subject: Re: [MIPS] Fix and cleanup the MIPS part of the (ab)use of CLOCK_TICK_RATE.
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed, 07 Nov 2007 23:10:36 +0900 (JST)
Cc: ralf@linux-mips.org
In-reply-to: <S20025770AbXKAPqq/20071101154646Z+4363@ftp.linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <S20025770AbXKAPqq/20071101154646Z+4363@ftp.linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Thu, 01 Nov 2007 15:46:41 +0000, linux-mips@linux-mips.org wrote:
> Author: Ralf Baechle <ralf@linux-mips.org> Thu Nov 1 15:45:37 2007 +0000
> Commit: 0a354a30fe552b78a4db0873c19d8936551cc158
> Gitweb: http://www.linux-mips.org/g/linux/0a354a30
> Branch: master
> 
> This is the clock rate of the i8253 PIT.  A MIPS system may not have
> a PIT by the symbol is used all over the kernel including some APIs.
> So keeping it defined to the number for the PIT is the only sane thing
> for now.

The CLOCK_TICK_RATE is used for ACTHZ, TICK_NSEC, etc.

At least for i8253-free platforms, It looks a value multiple of HZ
would be better for such constants, assuming we have dyntick or
accurate HZ clockevents.

How about something like this?

diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h
index 5816ad1..e9622b6 100644
--- a/include/asm-mips/timex.h
+++ b/include/asm-mips/timex.h
@@ -18,7 +18,11 @@
  * So keeping it defined to the number for the PIT is the only sane thing
  * for now.
  */
+#ifdef CONFIG_I8253
 #define CLOCK_TICK_RATE 1193182
+#else
+#define CLOCK_TICK_RATE 1024000        /* multiple of HZ */
+#endif
 
 /*
  * Standard way to access the cycle counter.

<Prev in Thread] Current Thread [Next in Thread>