From 34aaaa948e3c9dd65b27fa499c5c9e8d8f1227cf Mon Sep 17 00:00:00 2001 From: "Han, Weidong" Date: Sat, 4 Apr 2009 17:21:26 +0800 Subject: [PATCH] x86, dmar: check if it's initialized before disable queue invalidation If queue invalidation is disabled after it's already initialized, dmar_enable_qi won't re-enable it due to iommu->qi is allocated. It may result in system hang when use queue invalidation. Add this check to avoid this case. Signed-off-by: Weidong Han Signed-off-by: David Woodhouse --- drivers/pci/intr_remapping.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c index ef25caa..472be1c 100644 --- a/drivers/pci/intr_remapping.c +++ b/drivers/pci/intr_remapping.c @@ -524,6 +524,13 @@ int __init enable_intr_remapping(int eim) struct intel_iommu *iommu = drhd->iommu; /* + * If the queued invalidation is already initialized, + * shouldn't disable it. + */ + if (iommu->qi) + continue; + + /* * Clear previous faults. */ dmar_fault(-1, iommu); -- 1.8.2.3