lkml.org 
[lkml]   [2014]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/5] iommu/vt-d: Move supported-checks to intel_prepare_irq_remapping()
Date
From: Joerg Roedel <jroedel@suse.de>

The checks for IRQ remapping support rely on ordering with
dmar_table_init(), which is called in
intel_prepare_irq_remapping(). Move the checks for IRQ
remapping support to this function to ensure the right
ordering.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/iommu/intel_irq_remapping.c | 39 +++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 45223ea..0c9226f 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -512,23 +512,6 @@ static int __init dmar_x2apic_optout(void)

static int __init intel_irq_remapping_supported(void)
{
- if (disable_irq_remap)
- return 0;
- if (irq_remap_broken) {
- printk(KERN_WARNING
- "This system BIOS has enabled interrupt remapping\n"
- "on a chipset that contains an erratum making that\n"
- "feature unstable. To maintain system stability\n"
- "interrupt remapping is being disabled. Please\n"
- "contact your BIOS vendor for an update\n");
- add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
- disable_irq_remap = 1;
- return 0;
- }
-
- if (!dmar_ir_support())
- return 0;
-
return 1;
}

@@ -553,6 +536,24 @@ static int __init intel_prepare_irq_remapping(void)
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu;

+ /* First check whether IRQ remapping should be enabled */
+ if (disable_irq_remap)
+ return -1;
+
+ /* Are we running on sane hardware? */
+ if (irq_remap_broken) {
+ printk(KERN_WARNING
+ "This system BIOS has enabled interrupt remapping\n"
+ "on a chipset that contains an erratum making that\n"
+ "feature unstable. To maintain system stability\n"
+ "interrupt remapping is being disabled. Please\n"
+ "contact your BIOS vendor for an update\n");
+ add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
+ disable_irq_remap = 1;
+ return -1;
+ }
+
+ /* Everthing seems fine so far, parse the DMAR table */
if (dmar_table_init() < 0)
return -1;

@@ -561,6 +562,10 @@ static int __init intel_prepare_irq_remapping(void)
goto error;
}

+ /* Is interrupt remapping supported by hardware? */
+ if (!dmar_ir_support())
+ return 0;
+
/* First make sure all IOMMUs support IRQ remapping */
for_each_iommu(iommu, drhd)
if (!ecap_ir_support(iommu->ecap))
--
1.9.1


\
 
 \ /
  Last update: 2014-12-15 16:41    [W:0.057 / U:7.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site