linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Arnd Hannemann <hannemann@i4.informatik.rwth-aachen.de>,
	Jordan Crouse <jordan.crouse@amd.com>, Lars Heete <hel@admin.de>,
	Andres Salomon <dilinger@queued.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 1/2] x86: GEODE fix MFGPT input clock value
Date: Wed, 23 Jan 2008 23:10:53 +0100	[thread overview]
Message-ID: <20080123221053.GA2455@1wt.eu> (raw)
In-Reply-To: <4797BE43.9090600@zytor.com>

On Wed, Jan 23, 2008 at 02:22:59PM -0800, H. Peter Anvin wrote:
> Willy Tarreau wrote:
> >Hi Peter,
> >
> >On Wed, Jan 23, 2008 at 01:59:32PM -0800, H. Peter Anvin wrote:
> >>Willy Tarreau wrote:
> >>>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.
> >>>- *  Divisor   Hz      Min Delta (S) Max Delta (S)
> >>Seconds are "s", not "S" (S = siemens.)
> >
> >You're quite right. Same as we should write kHz and not Khz. But I'm
> >used to change other people's work and particularly comments the least
> >possible. Do you want an update ?
> >
> 
> I much prefer to see this done right.  I have a pretty case-sensitive 
> brain, it seems.

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


  reply	other threads:[~2008-01-23 22:42 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-16 17:44 2.6.24-rc8 hangs at mfgpt-timer Arnd Hannemann
2008-01-16 21:19 ` Andres Salomon
2008-01-16 21:56   ` Andres Salomon
2008-01-17  9:54     ` Arnd Hannemann
2008-01-17 18:40       ` Andres Salomon
2008-01-17 19:53         ` Arnd Hannemann
2008-01-17 20:42           ` Andres Salomon
2008-01-17 21:19           ` Jordan Crouse
2008-01-17 21:50             ` Arnd Hannemann
2008-01-17 22:36               ` Jordan Crouse
2008-01-17 22:52                 ` Arnd Hannemann
2008-01-17 22:57                   ` Jordan Crouse
2008-01-17 23:39                     ` Arnd Hannemann
2008-01-18  0:40                       ` Jordan Crouse
2008-01-21 23:27                       ` Jordan Crouse
2008-01-21 23:32                         ` Willy Tarreau
2008-01-22 20:15                           ` Willy Tarreau
2008-01-22 21:08                             ` Jordan Crouse
2008-01-22 21:15                               ` Willy Tarreau
2008-01-23 16:36                                 ` Jordan Crouse
2008-01-23 16:10                                   ` Willy Tarreau
2008-01-22  9:03                         ` Arnd Hannemann
2008-01-22 10:11                           ` Lars Heete
2008-01-22 11:18                             ` Arnd Hannemann
2008-01-22 18:15                               ` Jordan Crouse
2008-01-22 19:27                               ` Jordan Crouse
2008-01-22 20:54                                 ` Arnd Hannemann
2008-01-22 21:10                                   ` Ingo Molnar
2008-01-22 21:20                                     ` Willy Tarreau
2008-01-22 21:53                                     ` [git pull] was: " Thomas Gleixner
2008-01-23 21:17                                     ` [PATCH 0/2] Was: " Willy Tarreau
2008-01-23 21:18                                       ` [PATCH 1/2] x86: GEODE fix MFGPT input clock value Willy Tarreau
2008-01-23 21:59                                         ` H. Peter Anvin
2008-01-23 22:11                                           ` Willy Tarreau
2008-01-23 22:22                                             ` H. Peter Anvin
2008-01-23 22:10                                               ` Willy Tarreau [this message]
2008-01-23 22:38                                             ` Jordan Crouse
2008-01-23 23:17                                               ` Arnd Hannemann
2008-01-23 21:19                                       ` [PATCH 2/2] x86: GEODE add the "mfgptfix" boot time option to fix MFGPT timers Willy Tarreau
2008-01-19  1:06                   ` [GEODE] Geode GX/LX watchdog timer (was 2.6.24-rc8 hangs at mfgpt-timer) Jordan Crouse
2008-01-19  6:36                     ` Willy Tarreau
2008-01-20 13:22                     ` Arnd Hannemann
2008-01-20 16:34                       ` Jordan Crouse
2008-01-21 17:07                       ` Geode GX/LX watchdog timer (RESEND) Jordan Crouse
2008-01-21 18:37                         ` Arnd Hannemann
2008-02-17 14:14                           ` Iain Paton
2008-02-17 14:46                             ` Arnd Hannemann
2008-02-17 14:54                               ` Adrian Bunk
2008-02-17 16:10                                 ` Iain Paton
2008-02-17 17:32                                   ` Andres Salomon
2008-02-17 19:46                                   ` Arnd Hannemann
2008-01-20 20:16                     ` [GEODE] Geode GX/LX watchdog timer (was 2.6.24-rc8 hangs at mfgpt-timer) Lennart Sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080123221053.GA2455@1wt.eu \
    --to=w@1wt.eu \
    --cc=akpm@linux-foundation.org \
    --cc=dilinger@queued.net \
    --cc=hannemann@i4.informatik.rwth-aachen.de \
    --cc=hel@admin.de \
    --cc=hpa@zytor.com \
    --cc=jordan.crouse@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).