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

[Xen-changelog] [xen-unstable] x86: adjust pirq_spin_lock_irq_desc()



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1309549382 -3600
# Node ID 3261d198c3aa573ff7e8370b9787b72ba5dfa38a
# Parent  638f31a30b6ccb3fe26f79b991bed4cd03995809
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>
---


diff -r 638f31a30b6c -r 3261d198c3aa xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Jul 01 20:42:22 2011 +0100
+++ b/xen/arch/x86/irq.c        Fri Jul 01 20:43:02 2011 +0100
@@ -968,30 +968,31 @@
 }
 
 /*
- * 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;
 }
 

_______________________________________________
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®.