From: Thomas Gleixner <tglx@linutronix.de>
To: "Pan, Jacob jun" <jacob.jun.pan@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH v2 7/10] x86/tsc: enable APB timer based calibration
Date: Wed, 19 Aug 2009 17:51:00 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.0908191750140.3361@localhost.localdomain> (raw)
In-Reply-To: <43F901BD926A4E43B106BF17856F0755643EBDF9@orsmsx508.amr.corp.intel.com>
On Thu, 16 Jul 2009, Pan, Jacob jun wrote:
> >From e9264a1e5f8662d64f7d042544a03504b325bac9 Mon Sep 17 00:00:00 2001
> From: Jacob Pan <jacob.jun.pan@intel.com>
> Date: Wed, 15 Jul 2009 14:20:02 -0700
> Subject: [PATCH] x86/tsc: enable APB timer based calibration
>
> for platform that do not have PIT, we can use APB timer (if available)
> to calibrate TSC by counting the two. APB timer frequency is known to
> the system by SFI table provided by FW.
>
> Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
> ---
> arch/x86/kernel/tsc.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 6e1a368..8b38a9d 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -18,6 +18,9 @@
> #include <asm/delay.h>
> #include <asm/hypervisor.h>
>
> +#include <asm/platform_feature.h>
> +#include <asm/apb_timer.h>
> +
> unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
> EXPORT_SYMBOL(cpu_khz);
>
> @@ -394,6 +397,14 @@ unsigned long native_calibrate_tsc(void)
> return hv_tsc_khz;
> }
>
> + /* first check if apb timer exist and is usable */
> + if (platform_has(X86_PLATFORM_FEATURE_APBT)) {
> + local_irq_save(flags);
> + fast_calibrate = apbt_quick_calibrate();
> + local_irq_restore(flags);
> + if (fast_calibrate)
> + return fast_calibrate;
And what is calibrating the TSC here. There is not PIT or comes that
magically when the APBT thing fails ?
> + }
> local_irq_save(flags);
> fast_calibrate = quick_pit_calibrate();
> local_irq_restore(flags);
> --
> 1.5.6.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
prev parent reply other threads:[~2009-08-19 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 10:55 Pan, Jacob jun
2009-08-19 15:51 ` Thomas Gleixner [this message]
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=alpine.LFD.2.00.0908191750140.3361@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=jacob.jun.pan@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®