aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/apic_64.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
index 1e925be861e4..ac399d0f65c0 100644
--- a/arch/x86/kernel/apic_64.c
+++ b/arch/x86/kernel/apic_64.c
@@ -244,6 +244,9 @@ int lapic_get_maxlvt(void)
244 return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; 244 return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2;
245} 245}
246 246
247/* Clock divisor is set to 1 */
248#define APIC_DIVISOR 1
249
247/* 250/*
248 * This function sets up the local APIC timer, with a timeout of 251 * This function sets up the local APIC timer, with a timeout of
249 * 'clocks' APIC bus clock. During calibration we actually call 252 * 'clocks' APIC bus clock. During calibration we actually call
@@ -262,6 +265,9 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
262 lvtt_value = LOCAL_TIMER_VECTOR; 265 lvtt_value = LOCAL_TIMER_VECTOR;
263 if (!oneshot) 266 if (!oneshot)
264 lvtt_value |= APIC_LVT_TIMER_PERIODIC; 267 lvtt_value |= APIC_LVT_TIMER_PERIODIC;
268 if (!lapic_is_integrated())
269 lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV);
270
265 if (!irqen) 271 if (!irqen)
266 lvtt_value |= APIC_LVT_MASKED; 272 lvtt_value |= APIC_LVT_MASKED;
267 273
@@ -276,7 +282,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
276 | APIC_TDR_DIV_16); 282 | APIC_TDR_DIV_16);
277 283
278 if (!oneshot) 284 if (!oneshot)
279 apic_write(APIC_TMICT, clocks); 285 apic_write(APIC_TMICT, clocks / APIC_DIVISOR);
280} 286}
281 287
282/* 288/*
@@ -446,7 +452,7 @@ static int __init calibrate_APIC_clock(void)
446 lapic_clockevent.min_delta_ns = 452 lapic_clockevent.min_delta_ns =
447 clockevent_delta2ns(0xF, &lapic_clockevent); 453 clockevent_delta2ns(0xF, &lapic_clockevent);
448 454
449 calibration_result = result / HZ; 455 calibration_result = (result * APIC_DIVISOR) / HZ;
450 456
451 /* 457 /*
452 * Do a sanity check on the APIC calibration result 458 * Do a sanity check on the APIC calibration result