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

[Xen-changelog] [xen-unstable] move request_irq() into .init.text



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1301756167 -3600
# Node ID ccdec92e41bde49594bd91be13954638151608ce
# Parent  8d3a418ae2c697df6a782430df73c8c30b485b4a
move request_irq() into .init.text

With no modular drivers, all interrupt setup is supposed to happen
during boot.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---


diff -r 8d3a418ae2c6 -r ccdec92e41bd xen/arch/ia64/linux-xen/irq_ia64.c
--- a/xen/arch/ia64/linux-xen/irq_ia64.c        Sat Apr 02 15:55:36 2011 +0100
+++ b/xen/arch/ia64/linux-xen/irq_ia64.c        Sat Apr 02 15:56:07 2011 +0100
@@ -267,7 +267,7 @@
 }
 
 #ifdef XEN
-int request_irq_vector(unsigned int vector,
+int __init request_irq_vector(unsigned int vector,
                void (*handler)(int, void *, struct cpu_user_regs *),
                unsigned long irqflags, const char * devname, void *dev_id)
 {
diff -r 8d3a418ae2c6 -r ccdec92e41bd xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Sat Apr 02 15:55:36 2011 +0100
+++ b/xen/arch/x86/irq.c        Sat Apr 02 15:56:07 2011 +0100
@@ -643,7 +643,7 @@
 }
 __initcall(irq_ratelimit_init);
 
-int request_irq(unsigned int irq,
+int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
         unsigned long irqflags, const char * devname, void *dev_id)
 {
diff -r 8d3a418ae2c6 -r ccdec92e41bd xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c  Sat Apr 02 15:55:36 2011 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c  Sat Apr 02 15:56:07 2011 +0100
@@ -535,7 +535,7 @@
     spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
-static int set_iommu_interrupt_handler(struct amd_iommu *iommu)
+static int __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
 {
     int irq, ret;
 
diff -r 8d3a418ae2c6 -r ccdec92e41bd xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Sat Apr 02 15:55:36 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Sat Apr 02 15:56:07 2011 +0100
@@ -1038,7 +1038,7 @@
     .set_affinity = dma_msi_set_affinity,
 };
 
-static int iommu_set_interrupt(struct iommu *iommu)
+static int __init iommu_set_interrupt(struct iommu *iommu)
 {
     int irq, ret;
 
@@ -1937,7 +1937,6 @@
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     struct iommu_flush *flush = NULL;
-    int irq;
     int ret;
     unsigned long flags;
     struct irq_cfg *cfg;
@@ -1948,16 +1947,6 @@
     for_each_drhd_unit ( drhd )
     {
         iommu = drhd->iommu;
-        if ( iommu->irq < 0 )
-        {
-            irq = iommu_set_interrupt(iommu);
-            if ( irq < 0 )
-            {
-                dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: interrupt setup 
failed\n");
-                return irq;
-            }
-            iommu->irq = irq;
-        }
 
         cfg = irq_cfg(iommu->irq);
         dma_msi_set_affinity(iommu->irq, cfg->cpu_mask);
@@ -2060,6 +2049,7 @@
 {
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
+    int ret;
 
     if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
@@ -2092,6 +2082,14 @@
 
         if ( iommu_intremap && !ecap_intr_remap(iommu->ecap) )
             iommu_intremap = 0;
+
+        ret = iommu_set_interrupt(iommu);
+        if ( ret < 0 )
+        {
+            dprintk(XENLOG_ERR VTDPREFIX, "IOMMU: interrupt setup failed\n");
+            goto error;
+        }
+        iommu->irq = ret;
     }
 
     if ( !iommu_qinval && iommu_intremap )
@@ -2110,7 +2108,8 @@
 
     scan_pci_devices();
 
-    if ( init_vtd_hw() )
+    ret = init_vtd_hw();
+    if ( ret )
         goto error;
 
     register_keyhandler('V', &dump_iommu_info_keyhandler);
@@ -2123,7 +2122,7 @@
     iommu_passthrough = 0;
     iommu_qinval = 0;
     iommu_intremap = 0;
-    return -ENOMEM;
+    return ret;
 }
 
 /*

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