aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2017-06-16 10:09:59 -0400
committerJoerg Roedel <jroedel@suse.de>2017-06-22 06:54:21 -0400
commit7ad820e43330bbf974792c5ab4e2c2355e08d597 (patch)
tree45bcfe3f92893314f76441b09fd26931b84d2d38
parentf601927136d69be49f0a14ae820b44c02fa591ba (diff)
iommu/amd: Free IOMMU resources when disabled on command line
After we made sure that all IOMMUs have been disabled we need to make sure that all resources we allocated are released again. Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/iommu/amd_iommu_init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 8cc507f96f3a..128f9665c326 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -2430,6 +2430,13 @@ static int __init state_next(void)
2430 case IOMMU_IVRS_DETECTED: 2430 case IOMMU_IVRS_DETECTED:
2431 ret = early_amd_iommu_init(); 2431 ret = early_amd_iommu_init();
2432 init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; 2432 init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED;
2433 if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) {
2434 pr_info("AMD-Vi: AMD IOMMU disabled on kernel command-line\n");
2435 free_dma_resources();
2436 free_iommu_resources();
2437 init_state = IOMMU_CMDLINE_DISABLED;
2438 ret = -EINVAL;
2439 }
2433 break; 2440 break;
2434 case IOMMU_ACPI_FINISHED: 2441 case IOMMU_ACPI_FINISHED:
2435 early_enable_iommus(); 2442 early_enable_iommus();