Skip to contentSkip to conversation

accel/ivpu: Trigger engine reset for additional job status codes

PATCH In review Karol Wachowski 2 participants 3 messages Oct 7, 2025 – Oct 8, 2025

Subsystems (2)
lore
Share & tools
lore

Karol Wachowski

author maintainer
#0 lore raw

PATCH 1/1 accel/ivpu: Trigger engine reset for additional job status codes

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.

---
 drivers/accel/ivpu/ivpu_job.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_job.c +9 -1
index 17273c68f84c..fd548028f1d6 100644
@@ -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)
Signature · 1 line
2.43.0
author maintainer Applied
#2 lore raw

Applied to drm-misc-next.

Quoted 11 lines · Jeff Hugo
Quoted 8 lines · Karol Wachowski

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.