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

[Xen-devel] [PATCH] x86: adjust pirq_spin_lock_irq_desc()



Remove unnecessary/bogus assertions and add retry loop matching
domain_spin_lock_irq_desc().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -952,30 +952,31 @@ struct irq_desc *domain_spin_lock_irq_de
 }
 
 /*
- * Same with struct pirq already looked up, and d->event_lock already
- * held (thus the PIRQ <-> IRQ mapping can't change under our feet).
+ * Same with struct pirq already looked up.
  */
 struct irq_desc *pirq_spin_lock_irq_desc(
     struct domain *d, const struct pirq *pirq, unsigned long *pflags)
 {
-    int irq = pirq->arch.irq;
     struct irq_desc *desc;
     unsigned long flags;
 
-    ASSERT(spin_is_locked(&d->event_lock));
+    for ( ; ; )
+    {
+        int irq = pirq->arch.irq;
 
-    if ( irq <= 0 )
-        return NULL;
+        if ( irq <= 0 )
+            return NULL;
 
-    desc = irq_to_desc(irq);
-    spin_lock_irqsave(&desc->lock, flags);
+        desc = irq_to_desc(irq);
+        spin_lock_irqsave(&desc->lock, flags);
+        if ( irq == pirq->arch.irq )
+            break;
+        spin_unlock_irqrestore(&desc->lock, flags);
+    }
 
     if ( pflags )
         *pflags = flags;
 
-    ASSERT(pirq == pirq_info(d, domain_irq_to_pirq(d, irq)));
-    ASSERT(irq == pirq->arch.irq);
-
     return desc;
 }
 



Attachment: x86-pirq-irq-assertion.patch
Description: Text document

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

 


Rackspace

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