Commit 06687a03 authored by Suravee Suthikulpanit's avatar Suravee Suthikulpanit Committed by Joerg Roedel
Browse files

iommu/amd: Improve error handling for amd_iommu_init_pci

parent 754e0b0e
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1943,9 +1943,11 @@ static int __init amd_iommu_init_pci(void)

	for_each_iommu(iommu) {
		ret = iommu_init_pci(iommu);
		if (ret)
			break;

		if (ret) {
			pr_err("IOMMU%d: Failed to initialize IOMMU Hardware (error=%d)!\n",
			       iommu->index, ret);
			goto out;
		}
		/* Need to setup range after PCI init */
		iommu_set_cwwb_range(iommu);
	}
@@ -1961,6 +1963,11 @@ static int __init amd_iommu_init_pci(void)
	 * active.
	 */
	ret = amd_iommu_init_api();
	if (ret) {
		pr_err("IOMMU: Failed to initialize IOMMU-API interface (error=%d)!\n",
		       ret);
		goto out;
	}

	init_device_table_dma();

@@ -1970,6 +1977,7 @@ static int __init amd_iommu_init_pci(void)
	if (!ret)
		print_iommu_info();

out:
	return ret;
}