iommu/amd: Improve error handling for amd_iommu_init_pci
Add error messages to prevent silent failure. Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Link: https://lore.kernel.org/r/20220301085626.87680-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
754e0b0e35
commit
06687a0380
1 changed files with 11 additions and 3 deletions
|
@ -1943,9 +1943,11 @@ static int __init amd_iommu_init_pci(void)
|
||||||
|
|
||||||
for_each_iommu(iommu) {
|
for_each_iommu(iommu) {
|
||||||
ret = iommu_init_pci(iommu);
|
ret = iommu_init_pci(iommu);
|
||||||
if (ret)
|
if (ret) {
|
||||||
break;
|
pr_err("IOMMU%d: Failed to initialize IOMMU Hardware (error=%d)!\n",
|
||||||
|
iommu->index, ret);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
/* Need to setup range after PCI init */
|
/* Need to setup range after PCI init */
|
||||||
iommu_set_cwwb_range(iommu);
|
iommu_set_cwwb_range(iommu);
|
||||||
}
|
}
|
||||||
|
@ -1961,6 +1963,11 @@ static int __init amd_iommu_init_pci(void)
|
||||||
* active.
|
* active.
|
||||||
*/
|
*/
|
||||||
ret = amd_iommu_init_api();
|
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();
|
init_device_table_dma();
|
||||||
|
|
||||||
|
@ -1970,6 +1977,7 @@ static int __init amd_iommu_init_pci(void)
|
||||||
if (!ret)
|
if (!ret)
|
||||||
print_iommu_info();
|
print_iommu_info();
|
||||||
|
|
||||||
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue