public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] x86/apic: check global clockevent in lapic timer setup
@ 2009-12-17 17:59 Pan, Jacob jun
  2009-12-17 19:41 ` Cyrill Gorcunov
  0 siblings, 1 reply; 8+ messages in thread
From: Pan, Jacob jun @ 2009-12-17 17:59 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel@vger.kernel.org, x86@kernel.org

>From 5b3b795b42796e326d34713d4785c161b52e04db Mon Sep 17 00:00:00 2001
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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-12-18 22:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-17 17:59 [PATCH 2/2] x86/apic: check global clockevent in lapic timer setup Pan, Jacob jun
2009-12-17 19:41 ` Cyrill Gorcunov
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox