[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86 hpet: two more fixes for c/s 19419



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1238591086 -3600
# Node ID 4da7f15e91262866bc6b0cdfee8883f4d2810955
# Parent  2491158ccd173786590340cbcf77985f66cd2b8f
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@xxxxxxxxxx>
---
 xen/arch/x86/hpet.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -r 2491158ccd17 -r 4da7f15e9126 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Wed Apr 01 13:49:35 2009 +0100
+++ b/xen/arch/x86/hpet.c       Wed Apr 01 14:04:46 2009 +0100
@@ -45,7 +45,7 @@ static unsigned int num_hpets_used; /* m
 
 DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
 
-static int vector_channel[NR_IRQS] = {[0 ... NR_IRQS-1] = -1};
+static int vector_channel[NR_VECTORS] = {[0 ... NR_VECTORS-1] = -1};
 
 #define vector_to_channel(vector)   vector_channel[vector]
 
@@ -344,6 +344,9 @@ static int hpet_assign_irq(struct hpet_e
 static int hpet_assign_irq(struct hpet_event_channel *ch)
 {
     int vector;
+
+    if ( ch->vector )
+        return 0;
 
     if ( (vector = assign_irq_vector(AUTO_ASSIGN_IRQ)) < 0 )
         return vector;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.