Skip to contentSkip to conversation

fix get_free_pirq

PATCH New Qing He 1 participant 1 message Aug 28, 2009

lore
Share & tools
lore

Qing He

author
#0 lore raw

PATCH 1/1 fix get_free_pirq

GSI should not be allocated for other purpose, so change the hard code limit.

Also fix the out of loop checking, it should be '<' instead of '=='.

---

xen/arch/x86/irq.c +2 -2
diff -r e8004f6c254a xen/arch/x86/irq.c
@@ -1254,10 +1254,10 @@ int get_free_pirq(struct domain *d, int 
     }
     else
     {
-        for ( i = d->nr_pirqs - 1; i >= 16; i-- )
+        for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- )
             if ( !d->arch.pirq_irq[i] )
                 break;
-        if ( i == 16 )
+        if ( i < nr_irqs_gsi )
             return -ENOSPC;
     }