Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: H. Peter Anvin <hpa@...>
Cc: Ingo Molnar <mingo@...>, Arnd Hannemann <hannemann@...>, Jordan Crouse <jordan.crouse@...>, Lars Heete <hel@...>, Andres Salomon <dilinger@...>, Linux Kernel Mailing List <linux-kernel@...>, Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>, Linus Torvalds <torvalds@...>
Date: Wednesday, January 23, 2008 - 6:10 pm

On Wed, Jan 23, 2008 at 02:22:59PM -0800, H. Peter Anvin wrote:

Oh rest assured that you're not alone. I was smiling reading Andrew's
comments about people who "cnat tpye", and I must admit that I too am
often quite irritated by incorrect case and inverted letters, but I try
to refrain from whining, people say that I do it too much and for nothing :-)

OK, here it comes updated.

Willy


From 3a314dd5c2a694f5b0a1c1b8b5690ee28f711b5e Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Wed, 23 Jan 2008 23:05:50 +0100
Subject: [PATCH 1/2] x86: GEODE fix MFGPT input clock value

The GEODE MFGPT code assumed that 32kHz was 32000 Hz while the boards
run on a 32.768 kHz digital watch crystal. In practise, it will not
change the timer's frequency as the skew was only 2.4%, but it
should provide more accurate intervals.

Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 arch/x86/kernel/mfgpt_32.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 3960ab7..f97e6e3 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -12,21 +12,20 @@
  */
 
 /*
- * We are using the 32Khz input clock - its the only one that has the
+ * We are using the 32.768kHz input clock - its the only one that has the
  * ranges we find desirable.  The following table lists the suitable
- * divisors and the associated hz, minimum interval
- * and the maximum interval:
+ * divisors and the associated Hz, minimum interval and the maximum interval:
  *
- *  Divisor   Hz      Min Delta (S) Max Delta (S)
- *   1        32000     .0005          2.048
- *   2        16000      .001          4.096
- *   4         8000      .002          8.192
- *   8         4000      .004         16.384
- *   16        2000      .008         32.768
- *   32        1000      .016         65.536
- *   64         500      .032        131.072
- *  128         250      .064        262.144
- *  256         125      .128        524.288
+ *  Divisor   Hz      Min Delta (s)  Max Delta (s)
+ *   1        32768   .00048828125      2.000
+ *   2        16384   .0009765625       4.000
+ *   4         8192   .001953125        8.000
+ *   8         4096   .00390625        16.000
+ *   16        2048   .0078125         32.000
+ *   32        1024   .015625          64.000
+ *   64         512   .03125          128.000
+ *  128         256   .0625           256.000
+ *  256         128   .125            512.000
  */
 
 #include <linux/kernel.h>
@@ -45,7 +44,7 @@ static struct mfgpt_timer_t {
 
 #define MFGPT_DIVISOR 16
 #define MFGPT_SCALE  4     /* divisor = 2^(scale) */
-#define MFGPT_HZ  (32000 / MFGPT_DIVISOR)
+#define MFGPT_HZ  (32768 / MFGPT_DIVISOR)
 #define MFGPT_PERIODIC (MFGPT_HZ / HZ)
 
 #ifdef CONFIG_GEODE_MFGPT_TIMER
-- 
1.5.3.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Wed Jan 16, 1:44 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Wed Jan 16, 5:19 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Wed Jan 16, 5:56 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 5:54 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Thu Jan 17, 2:40 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 3:53 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 5:19 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 5:50 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 6:36 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 6:52 pm)
Re: Geode GX/LX watchdog timer (RESEND), Jordan Crouse, (Mon Jan 21, 1:07 pm)
Re: Geode GX/LX watchdog timer (RESEND), Arnd Hannemann, (Mon Jan 21, 2:37 pm)
Re: Geode GX/LX watchdog timer (RESEND), Iain Paton, (Sun Feb 17, 10:14 am)
Re: Geode GX/LX watchdog timer (RESEND), Arnd Hannemann, (Sun Feb 17, 10:46 am)
Re: Geode GX/LX watchdog timer (RESEND), Adrian Bunk, (Sun Feb 17, 10:54 am)
Re: Geode GX/LX watchdog timer (RESEND), Iain Paton, (Sun Feb 17, 12:10 pm)
Re: Geode GX/LX watchdog timer (RESEND), Arnd Hannemann, (Sun Feb 17, 3:46 pm)
Re: Geode GX/LX watchdog timer (RESEND), Andres Salomon, (Sun Feb 17, 1:32 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 6:57 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Thu Jan 17, 7:39 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Mon Jan 21, 7:27 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Tue Jan 22, 5:03 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Lars Heete, (Tue Jan 22, 6:11 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Tue Jan 22, 7:18 am)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Tue Jan 22, 3:27 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Arnd Hannemann, (Tue Jan 22, 4:54 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Ingo Molnar, (Tue Jan 22, 5:10 pm)
[PATCH 0/2] Was: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Wed Jan 23, 5:17 pm)
[PATCH 1/2] x86: GEODE fix MFGPT input clock value, Willy Tarreau, (Wed Jan 23, 5:18 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, H. Peter Anvin, (Wed Jan 23, 5:59 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, Willy Tarreau, (Wed Jan 23, 6:11 pm)
Re: x86: GEODE fix MFGPT input clock value, Jordan Crouse, (Wed Jan 23, 6:38 pm)
Re: x86: GEODE fix MFGPT input clock value, Arnd Hannemann, (Wed Jan 23, 7:17 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, H. Peter Anvin, (Wed Jan 23, 6:22 pm)
Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value, Willy Tarreau, (Wed Jan 23, 6:10 pm)
[git pull] was: Re: 2.6.24-rc8 hangs at mfgpt-timer, Thomas Gleixner, (Tue Jan 22, 5:53 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Tue Jan 22, 5:20 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Tue Jan 22, 2:15 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Mon Jan 21, 7:32 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Tue Jan 22, 4:15 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Tue Jan 22, 5:08 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Tue Jan 22, 5:15 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Wed Jan 23, 12:36 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Willy Tarreau, (Wed Jan 23, 12:10 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Jordan Crouse, (Thu Jan 17, 8:40 pm)
Re: 2.6.24-rc8 hangs at mfgpt-timer, Andres Salomon, (Thu Jan 17, 4:42 pm)