ia64/xen-unstable

changeset 19493:4da7f15e9126

x86 hpet: two more fixes for c/s 19419

vector_channel[], as its name already says, is vector-, not
irq-indexed.

hpet_assign_irq() sits not only in the boot path, but also in the
resume one. Short of knowing why this is, simply checking whether a
vector was already assigned prevents leaking previously assigned ones.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 01 14:04:46 2009 +0100 (2009-04-01)
parents 2491158ccd17
children e89f7c2b9e0d
files xen/arch/x86/hpet.c
line diff
     1.1 --- a/xen/arch/x86/hpet.c	Wed Apr 01 13:49:35 2009 +0100
     1.2 +++ b/xen/arch/x86/hpet.c	Wed Apr 01 14:04:46 2009 +0100
     1.3 @@ -45,7 +45,7 @@ static unsigned int num_hpets_used; /* m
     1.4  
     1.5  DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
     1.6  
     1.7 -static int vector_channel[NR_IRQS] = {[0 ... NR_IRQS-1] = -1};
     1.8 +static int vector_channel[NR_VECTORS] = {[0 ... NR_VECTORS-1] = -1};
     1.9  
    1.10  #define vector_to_channel(vector)   vector_channel[vector]
    1.11  
    1.12 @@ -345,6 +345,9 @@ static int hpet_assign_irq(struct hpet_e
    1.13  {
    1.14      int vector;
    1.15  
    1.16 +    if ( ch->vector )
    1.17 +        return 0;
    1.18 +
    1.19      if ( (vector = assign_irq_vector(AUTO_ASSIGN_IRQ)) < 0 )
    1.20          return vector;
    1.21