Re: [PATCH v7 09/12] iommu: Make iommu_queue_iopf() more generic

From: Baolu Lu
Date: Tue Dec 05 2023 - 07:13:46 EST


On 2023/12/5 15:13, Yi Liu wrote:
@@ -157,8 +173,8 @@ int iommu_queue_iopf(struct iommu_fault *fault, struct device *dev)
      group->dev = dev;
      group->last_fault.fault = *fault;
      INIT_LIST_HEAD(&group->faults);
+    group->domain = domain;
      list_add(&group->last_fault.list, &group->faults);
-    INIT_WORK(&group->work, iopf_handler);
      /* See if we have partial faults for this group */
      list_for_each_entry_safe(iopf, next, &iopf_param->partial, list) {
@@ -167,9 +183,13 @@ int iommu_queue_iopf(struct iommu_fault *fault, struct device *dev)
              list_move(&iopf->list, &group->faults);
      }
-    queue_work(iopf_param->queue->wq, &group->work);
-    return 0;
+    mutex_unlock(&iopf_param->lock);
+    ret = domain->iopf_handler(group);
+    mutex_lock(&iopf_param->lock);

After this change, this function (iommu_queue_iopf) does not queue
anything. Should this function be renamed? Except this, I didn't see
other problem.

It's renamed in the next patch.


Reviewed-by:Yi Liu <yi.l.liu@xxxxxxxxx>

Thank you!

Best regards,
baolu