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

[Xen-changelog] [xen-unstable] x86: com devices's irqaction shouldn't free.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1251959847 -3600
# Node ID 74bbd1eb759885aaf8e76b27a49a9115a9d35f69
# Parent  cfcfc0856b2f3fd57c3b5ff3e4e27106b2c72888
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>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/irq.c    |    3 ++-
 xen/include/xen/irq.h |    8 +++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff -r cfcfc0856b2f -r 74bbd1eb7598 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Thu Sep 03 07:29:29 2009 +0100
+++ b/xen/arch/x86/irq.c        Thu Sep 03 07:37:27 2009 +0100
@@ -537,6 +537,7 @@ int request_irq(unsigned int irq,
     action->handler = handler;
     action->name = devname;
     action->dev_id = dev_id;
+    action->free_on_release = 1;
 
     retval = setup_irq(irq, action);
     if (retval)
@@ -564,7 +565,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 (action && action->free_on_release)
         xfree(action);
 }
 
diff -r cfcfc0856b2f -r 74bbd1eb7598 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Thu Sep 03 07:29:29 2009 +0100
+++ b/xen/include/xen/irq.h     Thu Sep 03 07:37:27 2009 +0100
@@ -7,11 +7,11 @@
 #include <asm/regs.h>
 #include <asm/hardirq.h>
 
-struct irqaction
-{
+struct irqaction {
     void (*handler)(int, void *, struct cpu_user_regs *);
     const char *name;
     void *dev_id;
+    bool_t free_on_release;
 };
 
 /*
@@ -63,10 +63,8 @@ struct irq_cfg;
  * This is the "IRQ descriptor", which contains various information
  * about the irq, including what kind of hardware handling it has,
  * whether it is disabled etc etc.
- *
- * Pad this out to 32 bytes for cache and indexing reasons.
  */
-typedef struct irq_desc{
+typedef struct irq_desc {
     unsigned int status;               /* IRQ status */
     hw_irq_controller *handler;
     struct msi_desc   *msi_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®.