[PATCH 2/2] x86/apic: check global clockevent in lapic timer setup

From: Jacob Pan
Date: Thu Dec 17 2009 - 11:07:57 EST


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@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/