WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] evtchn_ia64 spin lock

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] evtchn_ia64 spin lock
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 2 Feb 2006 14:27:58 +0900
Delivery-date: Thu, 02 Feb 2006 05:37:50 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Node ID 2720886bc12276e994a4b61d07201bd173c8c96c
# Parent  5fcc346d6fe086436977a9b171f2bdb3a177d828
fix dead lock.
added spin_unlock() in case error occurs.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 5fcc346d6fe0 -r 2720886bc122 
linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c  Thu Jan 26 
11:31:28 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c  Thu Feb  2 
14:25:13 2006 +0900
@@ -106,8 +106,10 @@
     BUG_ON(HYPERVISOR_event_channel_op(&op) != 0 );
     evtchn = op.u.bind_virq.port;
 
-    if (!unbound_irq(evtchn))
-       return -EINVAL;
+    if (!unbound_irq(evtchn)) {
+        evtchn = -EINVAL;
+        goto out;
+    }
 
     evtchns[evtchn].handler = handler;
     evtchns[evtchn].dev_id = dev_id;
@@ -115,6 +117,7 @@
     irq_info[evtchn] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
 
     unmask_evtchn(evtchn);
+out:
     spin_unlock(&irq_mapping_update_lock);
     return evtchn;
 }
@@ -125,8 +128,10 @@
 {
     spin_lock(&irq_mapping_update_lock);
 
-    if (!unbound_irq(evtchn))
-       return -EINVAL;
+    if (!unbound_irq(evtchn)) {
+       evtchn = -EINVAL;
+       goto out;
+    }
 
     evtchns[evtchn].handler = handler;
     evtchns[evtchn].dev_id = dev_id;
@@ -134,6 +139,7 @@
     irq_info[evtchn] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);
 
     unmask_evtchn(evtchn);
+out:
     spin_unlock(&irq_mapping_update_lock);
     return evtchn;
 }
@@ -158,7 +164,7 @@
     spin_lock(&irq_mapping_update_lock);
 
     if (unbound_irq(irq))
-        return;
+        goto out;
 
     op.cmd = EVTCHNOP_close;
     op.u.close.port = evtchn;
@@ -179,6 +185,7 @@
     evtchns[evtchn].handler = NULL;
     evtchns[evtchn].opened = 0;
 
+out:
     spin_unlock(&irq_mapping_update_lock);
 }
 


-- 
yamahata

Attachment: 8672:2720886bc122.patch
Description: Text document

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH] evtchn_ia64 spin lock, Isaku Yamahata <=