From: Andrzej Kacprowski <[email protected]> Trigger engine reset for any status code in the range. This allows to add additional status codes in the future without breaking compatibility between the firmware and the driver.
Signed-off-by: Andrzej Kacprowski <[email protected]> Signed-off-by: Karol Wachowski <[email protected]> --- drivers/accel/ivpu/ivpu_job.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/accel/ivpu/ivpu_job.c b/drivers/accel/ivpu/ivpu_job.c index 17273c68f84c..fd548028f1d6 100644 --- a/drivers/accel/ivpu/ivpu_job.c +++ b/drivers/accel/ivpu/ivpu_job.c @@ -574,7 +574,11 @@ static int ivpu_job_signal_and_destroy(struct ivpu_device *vdev, u32 job_id, u32 if (!job) return -ENOENT; - if (job_status == VPU_JSM_STATUS_MVNCI_CONTEXT_VIOLATION_HW) { + switch (job_status) { + case VPU_JSM_STATUS_PROCESSING_ERR: + case VPU_JSM_STATUS_ENGINE_RESET_REQUIRED_MIN ... VPU_JSM_STATUS_ENGINE_RESET_REQUIRED_MAX: + { + /* Trigger an engine reset */ guard(mutex)(&job->file_priv->lock); if (job->file_priv->has_mmu_faults) @@ -589,6 +593,10 @@ static int ivpu_job_signal_and_destroy(struct ivpu_device *vdev, u32 job_id, u32 queue_work(system_wq, &vdev->context_abort_work); return 0; } + default: + /* Complete job with error status, engine reset not required */ + break; + } job = ivpu_job_remove_from_submitted_jobs(vdev, job_id); if (!job) -- 2.43.0
