From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: [PATCH 1/5] iommu/vt-d: Allocate IRQ remapping data structures only for all IOMMUs Date: Mon, 15 Dec 2014 16:13:20 +0100 Message-ID: <1418656404-28575-2-git-send-email-joro@8bytes.org> References: <1418656404-28575-1-git-send-email-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1418656404-28575-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Thomas Gleixner , Ingo Molnar , hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Joerg Roedel , Jiang Liu , Borislav Petkov Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Joerg Roedel , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: iommu@lists.linux-foundation.org From: Joerg Roedel 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 --- 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