iommu/vt-d: Enable Translation only if it was previously disabled
authorJoerg Roedel <jroedel@suse.de>
Fri, 12 Jun 2015 12:40:01 +0000 (14:40 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 16 Jun 2015 08:59:35 +0000 (10:59 +0200)
Do not touch the TE bit unless we know translation is
disabled.

Tested-by: ZhenHua Li <zhen-hual@hp.com>
Tested-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c

index e40c858a84feff0079340f120ebefe6837a65ff1..a98a7b27aca1dec2cb2f53319df8a49abcf8e645 100644 (file)
@@ -3204,7 +3204,9 @@ domains_done:
                if (ret)
                        goto free_iommu;
 
-               iommu_enable_translation(iommu);
+               if (!translation_pre_enabled(iommu))
+                       iommu_enable_translation(iommu);
+
                iommu_disable_protect_mem_regions(iommu);
        }