|
@@ -1304,6 +1304,8 @@ static int __init amd_iommu_init(void)
|
|
if (ret)
|
|
if (ret)
|
|
goto free;
|
|
goto free;
|
|
|
|
|
|
|
|
+ enable_iommus();
|
|
|
|
+
|
|
if (iommu_pass_through)
|
|
if (iommu_pass_through)
|
|
ret = amd_iommu_init_passthrough();
|
|
ret = amd_iommu_init_passthrough();
|
|
else
|
|
else
|
|
@@ -1316,8 +1318,6 @@ static int __init amd_iommu_init(void)
|
|
|
|
|
|
amd_iommu_init_notifier();
|
|
amd_iommu_init_notifier();
|
|
|
|
|
|
- enable_iommus();
|
|
|
|
-
|
|
|
|
if (iommu_pass_through)
|
|
if (iommu_pass_through)
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
@@ -1331,6 +1331,7 @@ out:
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
free:
|
|
free:
|
|
|
|
+ disable_iommus();
|
|
|
|
|
|
amd_iommu_uninit_devices();
|
|
amd_iommu_uninit_devices();
|
|
|
|
|