From: Andrew Morton <akpm@linux-foundation.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, Andi Kleen <ak@suse.de>,
Stable Team <stable@kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] X86_64: hpet tsc calibration fix broken smi detection logic
Date: Wed, 18 Jul 2007 19:59:32 -0700 [thread overview]
Message-ID: <20070718195932.ea72e6f0.akpm@linux-foundation.org> (raw)
In-Reply-To: <1184402499.12353.340.camel@chaos>
On Sat, 14 Jul 2007 10:41:39 +0200 Thomas Gleixner <tglx@linutronix.de> wrote:
> The current SMI detection logic in read_hpet_tsc() makes sure,
> that when a SMI happens between the read of the HPET counter and
> the read of the TSC, this wrong value is used for TSC calibration.
>
> This is not the intention of the function. The comparison must ensure,
> that we do _NOT_ use such a value.
>
> Fix the check to use calibration values where delta of the two TSC reads
> is smaller than a reasonable threshold.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>
> --- a/arch/x86_64/kernel/hpet.c
> +++ b/arch/x86_64/kernel/hpet.c
> @@ -190,7 +190,7 @@ int hpet_reenable(void)
> */
>
> #define TICK_COUNT 100000000
> -#define TICK_MIN 5000
> +#define SMI_THRESHOLD 50000
> #define MAX_TRIES 5
>
> /*
> @@ -205,7 +205,7 @@ static void __init read_hpet_tsc(int *hpet, int *tsc)
> tsc1 = get_cycles_sync();
> hpet1 = hpet_readl(HPET_COUNTER);
> tsc2 = get_cycles_sync();
> - if (tsc2 - tsc1 > TICK_MIN)
> + if ((tsc2 - tsc1) < SMI_TRESHOLD)
> break;
> }
> *hpet = hpet1;
>
So I queued this, and then another patch to revert it so that the
x86_64-clockevents conversion would apply. But I was unable to locate the
corresponding bug in the post-x86_64-clockevents tree. Did it get fixed by
other means in there?
next prev parent reply other threads:[~2007-07-19 3:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-14 8:41 [PATCH] X86_64: hpet tsc calibration fix broken smi detection logic Thomas Gleixner
2007-07-19 2:59 ` Andrew Morton [this message]
2007-07-19 13:52 ` Andi Kleen
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=20070718195932.ea72e6f0.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=stable@kernel.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.