[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4889C723.7050402@fujitsu-siemens.com>
Date: Fri, 25 Jul 2008 14:29:23 +0200
From: Martin Wilck <martin.wilck@...itsu-siemens.com>
To: Cyrill Gorcunov <gorcunov@...il.com>
CC: Thomas Gleixner <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"Wichert, Gerhard" <Gerhard.Wichert@...itsu-siemens.com>,
"Maciej W. Rozycki" <macro@...ux-mips.org>
Subject: Re: [PATCH] x86 (64): make calibrate_APIC_clock() SMI-safe (take
2)
Cyrill Gorcunov wrote:
> Hi Martin, what about the patch below - I simplified it a bit.
> Actually we have to handle 32bit mode as well I think.
Yes.
> Anyway,
> take a look. I don't really mind against your patch but we better
> should wait until Maciej could take a look (he will be able in
> a week or maybe a bit later).
>
> + for (i = 0; i < MAX_ITER; i++) {
> + rdtscll(tsc0);
> + *apic = apic_read(APIC_TMCCT);
> + rdtscll(tsc1);
> + diff = tsc1 - tsc0;
> + if (diff < MAX_DIFFERENCE) {
> + *tsc = tsc0 + diff / 2;
> + return 0;
> + }
> + }
> +
> + return -EIO ;
This is wrong - you need to set *tsc also in the -EIO case, otherwise
the function can return total bogus.
I have to say that my simplified patch failed to do the calibration
correctly on our test system (the original patch worked well). Please
stay tuned, we are investigating this currently.
Martin
--
Martin Wilck
PRIMERGY System Software Engineer
FSC IP ESP DEV 6
Fujitsu Siemens Computers GmbH
Heinz-Nixdorf-Ring 1
33106 Paderborn
Germany
Tel: ++49 5251 8 15113
Fax: ++49 5251 8 20209
Email: mailto:martin.wilck@...itsu-siemens.com
Internet: http://www.fujitsu-siemens.com
Company Details: http://www.fujitsu-siemens.com/imprint.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists