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 1/5] iommu/vt-d: Allocate IRQ remapping data structures only for all IOMMUs
Date
From: Joerg Roedel <jroedel@suse.de>

IRQ remapping is only supported when all IOMMUs in the
system support it. So check if all IOMMUs in the system
support IRQ remapping before doing the allocations.

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

diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index ff35b03..3ef63b8 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -568,14 +568,16 @@ static int __init intel_prepare_irq_remapping(void)
goto error;
}

- for_each_iommu(iommu, drhd) {
+ /* First make sure all IOMMUs support IRQ remapping */
+ for_each_iommu(iommu, drhd)
if (!ecap_ir_support(iommu->ecap))
- continue;
+ goto error;

- /* Do the allocations early */
+ /* Do the allocations early */
+ for_each_iommu(iommu, drhd)
if (intel_setup_irq_remapping(iommu))
goto error;
- }
+
return 0;
error:
intel_cleanup_irq_remapping();
--
1.9.1


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