From: Keir Fraser Date: Thu, 11 Sep 2008 15:50:04 +0000 (+0100) Subject: CPUIDLE: Disable APIC timer intr during C3 while force hpetbroadcast X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14111^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9672d65ba318cd055d2d58cc489032b7a32defb1;p=xen.git CPUIDLE: Disable APIC timer intr during C3 while force hpetbroadcast It can avoid C3 early exit, and also this is conceptually clearer, as at given time we only want one clock source to drive timers. Signed-off-by: Wei Gang Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index 3857cb0af6..5a660245b6 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -215,6 +215,8 @@ void hpet_broadcast_enter(void) spin_lock(&ch->lock); + disable_APIC_timer(); + cpu_set(smp_processor_id(), ch->cpumask); /* reprogram if current cpu expire time is nearer */ @@ -233,15 +235,13 @@ void hpet_broadcast_exit(void) if ( cpu_test_and_clear(cpu, ch->cpumask) ) { + /* Cancel any outstanding LAPIC event and re-enable interrupts. */ + reprogram_timer(0); + enable_APIC_timer(); + + /* Reprogram the deadline; trigger timer work now if it has passed. */ if ( !reprogram_timer(per_cpu(timer_deadline, cpu)) ) - { - /* - * The deadline must have passed -- trigger timer work now. - * Also cancel any outstanding LAPIC event. - */ - reprogram_timer(0); raise_softirq(TIMER_SOFTIRQ); - } if ( cpus_empty(ch->cpumask) && ch->next_event != STIME_MAX ) reprogram_hpet_evt_channel(ch, STIME_MAX, 0, 0);