From: Cyrill Gorcunov <gorcunov@gmail.com>
To: "Pan, Jacob jun" <jacob.jun.pan@intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"x86@kernel.org" <x86@kernel.org>
Subject: Re: [PATCH 2/2] x86/apic: check global clockevent in lapic timer setup
Date: Thu, 17 Dec 2009 22:41:48 +0300 [thread overview]
Message-ID: <20091217194148.GB5414@lenovo> (raw)
In-Reply-To: <43F901BD926A4E43B106BF17856F07559A257B5C@orsmsx508.amr.corp.intel.com>
On Thu, Dec 17, 2009 at 09:59:23AM -0800, Pan, Jacob jun wrote:
> From: Jacob Pan <jacob.jun.pan@intel.com>
> Date: Thu, 17 Dec 2009 08:07:57 -0800
> Subject: [PATCH 2/2] x86/apic: check global clockevent in lapic timer setup
>
> Global clockevent is needed to calibrate local apic timer.
> This patch makes sure we have a valid global clockevent prior
> to lapic timer setup.
> Non-pc x86 mid platform with per cpu platform timer may not
> have a global clockevent device.
>
> Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
> ---
> arch/x86/kernel/apic/apic.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index aa57c07..7e7aee1 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -724,6 +724,13 @@ static int __init calibrate_APIC_clock(void)
> */
> void __init setup_boot_APIC_clock(void)
> {
> + /* global clockevent is needed for calibration */
> + if (!global_clock_event) {
> + apic_printk(APIC_DEBUG,
> + "no global clockevent for calibration\n");
> + return;
> + }
> +
> /*
> * The local apic timer can be disabled via the kernel
> * commandline or from the CPU detection code. Register the lapic
> --
> 1.6.5.3
>
Hi Jacob,
Wouldn't be better to operate the same way as in case of "noapictimer"
boot option. I guess the non-pc x86 midplatforms you're mentioning
do not use SMP ever but just to be consistent in code.
Perhaps something like:
void __init setup_boot_APIC_clock(void) {
if (!global_clock_event) {
pr_info("No global clockevent for calibration\n");
disable_apic_timer = 1;
}
if (disable_apic_timer) {
pr_info("Disabling APIC timer\n");
/* No broadcast on UP ! */
if (num_possible_cpus() > 1) {
lapic_clockevent.mult = 1;
setup_APIC_timer();
}
return;
}
...
}
Or I miss something?
-- Cyrill
next prev parent reply other threads:[~2009-12-17 19:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 17:59 Pan, Jacob jun
2009-12-17 19:41 ` Cyrill Gorcunov [this message]
2009-12-17 22:31 ` Pan, Jacob jun
2009-12-17 22:34 ` H. Peter Anvin
2009-12-18 1:14 ` Pan, Jacob jun
2009-12-18 16:35 ` Thomas Gleixner
2009-12-18 18:13 ` Pan, Jacob jun
2009-12-18 22:44 ` Cyrill Gorcunov
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=20091217194148.GB5414@lenovo \
--to=gorcunov@gmail.com \
--cc=hpa@linux.intel.com \
--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®