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-devel

[Xen-devel] [PATCH] Don't free irqaction for com irq when release irq.

To: Xen <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Don't free irqaction for com irq when release irq.
From: "Zhang, Xiantao" <xiantao.zhang@xxxxxxxxx>
Date: Thu, 3 Sep 2009 12:14:50 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Wed, 02 Sep 2009 21:16:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcosTRSUhlwzY5qiQZ28V99eTxDLSA==
Thread-topic: [PATCH] Don't free irqaction for com irq when release irq.
# HG changeset patch
# User root@xxxxxxxxxxxxxxxxxxxxx
# Date 1251916103 14400
# Node ID 49e847aed58dde35f8a0f909999d01d97be6f531
# Parent  3b7cbf32fee909d860daacf70b8c3b97eaf036b5
x86: com devices's irqaction shouldn't free.

Since irqs of serial devices are initialized in early Xen and
its irqaction is not allocated from heap, so doesn't need free
in release irq logic.
Signed-off-by: Xiantao Zhang <xiantao.zhang@xxxxxxxxx>

diff -r 3b7cbf32fee9 -r 49e847aed58d xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Mon Aug 31 10:54:32 2009 +0100
+++ b/xen/arch/x86/irq.c        Wed Sep 02 14:28:23 2009 -0400
@@ -564,7 +564,7 @@ void release_irq(unsigned int irq)
     /* Wait to make sure it's not being used on another CPU */
     do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
 
-    if (action)
+    if ( !COM_IRQ(irq) && action )
         xfree(action);
 }
 
diff -r 3b7cbf32fee9 -r 49e847aed58d xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Mon Aug 31 10:54:32 2009 +0100
+++ b/xen/arch/x86/setup.c      Wed Sep 02 14:28:23 2009 -0400
@@ -464,10 +464,10 @@ void __init __start_xen(unsigned long mb
 
     /* We initialise the serial devices very early so we can get debugging. */
     ns16550.io_base = 0x3f8;
-    ns16550.irq     = 4;
+    ns16550.irq     = COM1_IRQ;
     ns16550_init(0, &ns16550);
     ns16550.io_base = 0x2f8;
-    ns16550.irq     = 3;
+    ns16550.irq     = COM2_IRQ;
     ns16550_init(1, &ns16550);
     console_init_preirq();
 
diff -r 3b7cbf32fee9 -r 49e847aed58d xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h Mon Aug 31 10:54:32 2009 +0100
+++ b/xen/include/asm-x86/irq.h Wed Sep 02 14:28:23 2009 -0400
@@ -26,6 +26,11 @@
 #define MAX_NR_IRQS (2 * MAX_GSI_IRQS)
 
 #define irq_cfg(irq)        &irq_cfg[(irq)]
+
+#define COM1_IRQ 4
+#define COM2_IRQ 3
+
+#define COM_IRQ(irq) ((irq) == COM1_IRQ || (irq) == COM2_IRQ)
 
 struct irq_cfg {
         int  vector;

Attachment: not_free_irqaction_for_serial_device_when_release_irq.patch
Description: not_free_irqaction_for_serial_device_when_release_irq.patch

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