Skip to content

Commit

Permalink
accel/ivpu: Add job status for jobs aborted by the driver
Browse files Browse the repository at this point in the history
Add DRM_IVPU_JOB_STATUS_ABORTED to indicate that the job was aborted
by the driver due to e.g. TDR or user context MMU faults.

This will help UMD and tests distinguish if job was aborted by the FW
or the driver.

Signed-off-by: Grzegorz Trzebiatowski <grzegorz.trzebiatowski@intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240126122804.2169129-8-jacek.lawrynowicz@linux.intel.com
  • Loading branch information
Grzegorz Trzebiatowski authored and Jacek Lawrynowicz committed Feb 6, 2024
1 parent 553099d commit 5f8408a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/accel/ivpu/ivpu_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static int ivpu_job_signal_and_destroy(struct ivpu_device *vdev, u32 job_id, u32
return -ENOENT;

if (job->file_priv->has_mmu_faults)
job_status = VPU_JSM_STATUS_ABORTED;
job_status = DRM_IVPU_JOB_STATUS_ABORTED;

job->bos[CMD_BUF_IDX]->job_status = job_status;
dma_fence_signal(job->done_fence);
Expand All @@ -315,7 +315,7 @@ void ivpu_jobs_abort_all(struct ivpu_device *vdev)
unsigned long id;

xa_for_each(&vdev->submitted_jobs_xa, id, job)
ivpu_job_signal_and_destroy(vdev, id, VPU_JSM_STATUS_ABORTED);
ivpu_job_signal_and_destroy(vdev, id, DRM_IVPU_JOB_STATUS_ABORTED);
}

static int ivpu_job_submit(struct ivpu_job *job)
Expand Down
1 change: 1 addition & 0 deletions include/uapi/drm/ivpu_accel.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ struct drm_ivpu_submit {

/* drm_ivpu_bo_wait job status codes */
#define DRM_IVPU_JOB_STATUS_SUCCESS 0
#define DRM_IVPU_JOB_STATUS_ABORTED 256

/**
* struct drm_ivpu_bo_wait - Wait for BO to become inactive
Expand Down

0 comments on commit 5f8408a

Please sign in to comment.