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 2/7] move request_irq() into .init.text

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2/7] move request_irq() into .init.text
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Thu, 31 Mar 2011 16:55:16 +0100
Delivery-date: Thu, 31 Mar 2011 08:56:12 -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
With no modular drivers, all interrupt setup is supposed to happen
during boot.

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

--- a/xen/arch/ia64/linux-xen/irq_ia64.c
+++ b/xen/arch/ia64/linux-xen/irq_ia64.c
@@ -267,7 +267,7 @@ register_percpu_irq (ia64_vector vec, st
 }
 
 #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)
 {
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -643,7 +643,7 @@ static int __init irq_ratelimit_init(voi
 }
 __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)
 {
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -535,7 +535,7 @@ static void amd_iommu_page_fault(int irq
     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;
 
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1038,7 +1038,7 @@ static hw_irq_controller dma_msi_type = 
     .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 @@ static int init_vtd_hw(void)
     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 @@ static int init_vtd_hw(void)
     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 @@ int __init intel_vtd_setup(void)
 {
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
+    int ret;
 
     if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
@@ -2092,6 +2082,14 @@ int __init intel_vtd_setup(void)
 
         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 @@ int __init intel_vtd_setup(void)
 
     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 @@ int __init intel_vtd_setup(void)
     iommu_passthrough = 0;
     iommu_qinval = 0;
     iommu_intremap = 0;
-    return -ENOMEM;
+    return ret;
 }
 
 /*



Attachment: request_irq-init.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/7] move request_irq() into .init.text, Jan Beulich <=