Skip to content

Commit e84e697

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: abort submissions during prepare on error
Forward errors from previous submissions to this one. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Luben Tuikov <luben.tuikov@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 89fae8d commit e84e697

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,27 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,
258258
struct dma_fence *fence = NULL;
259259
int r;
260260

261+
/* Ignore soft recovered fences here */
262+
r = drm_sched_entity_error(s_entity);
263+
if (r && r != -ENODATA)
264+
goto error;
265+
261266
if (!fence && job->gang_submit)
262267
fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit);
263268

264269
while (!fence && job->vm && !job->vmid) {
265270
r = amdgpu_vmid_grab(job->vm, ring, job, &fence);
266-
if (r)
271+
if (r) {
267272
DRM_ERROR("Error getting VM ID (%d)\n", r);
273+
goto error;
274+
}
268275
}
269276

270277
return fence;
278+
279+
error:
280+
dma_fence_set_error(&job->base.s_fence->finished, r);
281+
return NULL;
271282
}
272283

273284
static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job)

0 commit comments

Comments
 (0)