All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Don't free irqaction for com irq when release irq.
@ 2009-09-03  4:14 Zhang, Xiantao
  2009-09-03  6:14 ` Keir Fraser
  2009-09-03 15:48 ` Dan Magenheimer
  0 siblings, 2 replies; 13+ messages in thread
From: Zhang, Xiantao @ 2009-09-03  4:14 UTC (permalink / raw)
  To: Xen, Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 1952 bytes --]

# HG changeset patch
# User root@localhost.localdomain
# 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@intel.com>

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 #2: not_free_irqaction_for_serial_device_when_release_irq.patch --]
[-- Type: application/octet-stream, Size: 1899 bytes --]

# HG changeset patch
# User root@localhost.localdomain
# Date 1251916103 14400
# Node ID 49e847aed58dde35f8a0f909999d01d97be6f531
# Parent  3b7cbf32fee909d860daacf70b8c3b97eaf036b5
x86: com devices's irqaction shouldn't free.

Since irqs of serial devices are intialized 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@intel.com>

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 #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-09-04  1:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03  4:14 [PATCH] Don't free irqaction for com irq when release irq Zhang, Xiantao
2009-09-03  6:14 ` Keir Fraser
2009-09-03  8:14   ` Cui, Dexuan
2009-09-03  9:38   ` Zhang, Xiantao
2009-09-03 10:04     ` Christoph Egger
2009-09-03 10:20       ` Jan Beulich
2009-09-03 12:53       ` Zhang, Xiantao
2009-09-03 20:58         ` Jeremy Fitzhardinge
2009-09-04  1:54           ` Zhang, Xiantao
2009-09-03 15:48 ` Dan Magenheimer
2009-09-03 16:03   ` Jan Beulich
2009-09-03 16:26     ` Dan Magenheimer
2009-09-03 16:40       ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.