ia64/xen-unstable

changeset 18715:5bca96f74d59

hpet cpuidle: Observe IRQ-safe locking protocol.

Otherwise, may encounter deadlock.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Oct 23 12:01:03 2008 +0100 (2008-10-23)
parents 0358305c6883
children 6d45bf101d57
files xen/arch/x86/hpet.c
line diff
     1.1 --- a/xen/arch/x86/hpet.c	Thu Oct 23 11:53:52 2008 +0100
     1.2 +++ b/xen/arch/x86/hpet.c	Thu Oct 23 12:01:03 2008 +0100
     1.3 @@ -146,7 +146,7 @@ static void handle_hpet_broadcast(struct
     1.4      s_time_t now, next_event;
     1.5      int cpu;
     1.6  
     1.7 -    spin_lock(&ch->lock);
     1.8 +    spin_lock_irq(&ch->lock);
     1.9  
    1.10  again:
    1.11      ch->next_event = STIME_MAX;
    1.12 @@ -171,7 +171,7 @@ again:
    1.13          if ( reprogram_hpet_evt_channel(ch, next_event, now, 0) )
    1.14              goto again;
    1.15      }
    1.16 -    spin_unlock(&ch->lock);
    1.17 +    spin_unlock_irq(&ch->lock);
    1.18  }
    1.19  
    1.20  void hpet_broadcast_init(void)
    1.21 @@ -213,6 +213,7 @@ void hpet_broadcast_enter(void)
    1.22  {
    1.23      struct hpet_event_channel *ch = &hpet_event;
    1.24  
    1.25 +    ASSERT(!local_irq_is_enabled());
    1.26      spin_lock(&ch->lock);
    1.27  
    1.28      disable_APIC_timer();