From: Andrzej Kacprowski Date: Tue, 7 Oct 2025 08:35:11 +0000 (+0200) Subject: accel/ivpu: Trigger engine reset for additional job status codes X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4139eb2490cbc67cdeabea3cc3a08c3d7e4ce973;p=thirdparty%2Fkernel%2Flinux.git accel/ivpu: Trigger engine reset for additional job status codes 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 Reviewed-by: Jeff Hugo Signed-off-by: Karol Wachowski Link: https://lore.kernel.org/r/20251007083511.2817021-1-karol.wachowski@linux.intel.com --- diff --git a/drivers/accel/ivpu/ivpu_job.c b/drivers/accel/ivpu/ivpu_job.c index 17273c68f84c8..fd548028f1d64 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)