x86, dmar: check if it's initialized before disable queue invalidation
authorHan, Weidong <weidong.han@intel.com>
Sat, 4 Apr 2009 09:21:26 +0000 (17:21 +0800)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 4 Apr 2009 09:41:32 +0000 (10:41 +0100)
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 <weidong.han@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/pci/intr_remapping.c

index ef25caade54b743b9559fe6c11075d26841b16d9..472be1c3fff006ca3f6c1f4ae2d21c102732a0e6 100644 (file)
@@ -523,6 +523,13 @@ int __init enable_intr_remapping(int eim)
        for_each_drhd_unit(drhd) {
                struct intel_iommu *iommu = drhd->iommu;
 
+               /*
+                * If the queued invalidation is already initialized,
+                * shouldn't disable it.
+                */
+               if (iommu->qi)
+                       continue;
+
                /*
                 * Clear previous faults.
                 */