diff options
author | Suravee Suthikulpanit <[email protected]> | 2022-03-01 14:26:22 +0530 |
---|---|---|
committer | Joerg Roedel <[email protected]> | 2022-03-04 10:39:19 +0100 |
commit | 06687a03805e29dcf068a8e6436ed2a2bbd8b9e9 (patch) | |
tree | 428803a311a555edbb473ce19f1c5aad5664b384 | |
parent | 754e0b0e35608ed5206d6a67a791563c631cec07 (diff) |
iommu/amd: Improve error handling for amd_iommu_init_pci
Add error messages to prevent silent failure.
Signed-off-by: Vasant Hegde <[email protected]>
Signed-off-by: Suravee Suthikulpanit <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
-rw-r--r-- | drivers/iommu/amd/init.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index b10fb52ea442..6b5af568f3d5 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -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; } |