RE: [PATCH v8 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

Tian, Kevin
2023-12-28T06:17:28Z

> From: Liu, Yi L <yi.l.liu@intel.com>
> Sent: Thursday, December 28, 2023 12:14 AM
>
> @@ -1376,6 +1383,8 @@ int qi_submit_sync(struct intel_iommu *iommu,
> struct qi_desc *desc,
>
> restart:
> rc = 0;
> + if (fault)
> + *fault = 0;

move it to right before the loop of qi_check_fault()

>
> raw_spin_lock_irqsave(&qi->q_lock, flags);
> /*
> @@ -1430,7 +1439,7 @@ int qi_submit_sync(struct intel_iommu *iommu,
> struct qi_desc *desc,
> * a deadlock where the interrupt context can wait
> indefinitely
> * for free slots in the queue.
> */
> - rc = qi_check_fault(iommu, index, wait_index);
> + rc = qi_check_fault(iommu, index, wait_index, fault);
> if (rc)
> break;

and as replied in another thread let's change qi_check_fault to return
-ETIMEDOUT to break the restart loop when fault pointer is valid.