summaryrefslogtreecommitdiff
path: root/drivers/iommu/io-pgfault.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2024-02-12 09:22:27 +0800
committerJoerg Roedel <jroedel@suse.de>2024-02-16 15:19:37 +0100
commit3dfa64aecbafc288216b2790438d395add192c30 (patch)
treebba55e042efee5f069e5d67bdbbb2b6869311206 /drivers/iommu/io-pgfault.c
parentb554e396e51ce3d378a560666f85c6836a8323fd (diff)
downloadlwn-3dfa64aecbafc288216b2790438d395add192c30.tar.gz
lwn-3dfa64aecbafc288216b2790438d395add192c30.zip
iommu: Make iommu_report_device_fault() return void
As the iommu_report_device_fault() has been converted to auto-respond a page fault if it fails to enqueue it, there's no need to return a code in any case. Make it return void. Suggested-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Link: https://lore.kernel.org/r/20240212012227.119381-17-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/io-pgfault.c')
-rw-r--r--drivers/iommu/io-pgfault.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/iommu/io-pgfault.c b/drivers/iommu/io-pgfault.c
index 6a325bff8164..06d78fcc79fd 100644
--- a/drivers/iommu/io-pgfault.c
+++ b/drivers/iommu/io-pgfault.c
@@ -176,26 +176,22 @@ static struct iopf_group *iopf_group_alloc(struct iommu_fault_param *iopf_param,
* freed after the device has stopped generating page faults (or the iommu
* hardware has been set to block the page faults) and the pending page faults
* have been flushed.
- *
- * Return: 0 on success and <0 on error.
*/
-int iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
+void iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
{
struct iommu_fault *fault = &evt->fault;
struct iommu_fault_param *iopf_param;
struct iopf_group abort_group = {};
struct iopf_group *group;
- int ret;
iopf_param = iopf_get_dev_fault_param(dev);
if (WARN_ON(!iopf_param))
- return -ENODEV;
+ return;
if (!(fault->prm.flags & IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE)) {
- ret = report_partial_fault(iopf_param, fault);
+ report_partial_fault(iopf_param, fault);
iopf_put_dev_fault_param(iopf_param);
/* A request that is not the last does not need to be ack'd */
- return ret;
}
/*
@@ -207,25 +203,21 @@ int iommu_report_device_fault(struct device *dev, struct iopf_fault *evt)
* leaving, otherwise partial faults will be stuck.
*/
group = iopf_group_alloc(iopf_param, evt, &abort_group);
- if (group == &abort_group) {
- ret = -ENOMEM;
+ if (group == &abort_group)
goto err_abort;
- }
group->domain = get_domain_for_iopf(dev, fault);
- if (!group->domain) {
- ret = -EINVAL;
+ if (!group->domain)
goto err_abort;
- }
/*
* On success iopf_handler must call iopf_group_response() and
* iopf_free_group()
*/
- ret = group->domain->iopf_handler(group);
- if (ret)
+ if (group->domain->iopf_handler(group))
goto err_abort;
- return 0;
+
+ return;
err_abort:
iopf_group_response(group, IOMMU_PAGE_RESP_FAILURE);
@@ -233,7 +225,6 @@ err_abort:
__iopf_free_group(group);
else
iopf_free_group(group);
- return ret;
}
EXPORT_SYMBOL_GPL(iommu_report_device_fault);