Bläddra i källkod

iommu/amd: Fix missing iommu_shutdown initialization in passthrough mode

The iommu_shutdown callback is not initialized when the AMD
IOMMU driver runs in passthrough mode. Fix that by moving
the callback initialization before the check for
passthrough mode.

Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Cc: stable@vger.kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Shuah Khan 13 år sedan
förälder
incheckning
f2f12b6fc0
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      drivers/iommu/amd_iommu_init.c

+ 2 - 2
drivers/iommu/amd_iommu_init.c

@@ -1641,6 +1641,8 @@ static int __init amd_iommu_init(void)
 
 
 	amd_iommu_init_api();
 	amd_iommu_init_api();
 
 
+	x86_platform.iommu_shutdown = disable_iommus;
+
 	if (iommu_pass_through)
 	if (iommu_pass_through)
 		goto out;
 		goto out;
 
 
@@ -1649,8 +1651,6 @@ static int __init amd_iommu_init(void)
 	else
 	else
 		printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n");
 		printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n");
 
 
-	x86_platform.iommu_shutdown = disable_iommus;
-
 out:
 out:
 	return ret;
 	return ret;