Mark the entity as guilty so the ctx query IOCTL returns
the correct state.  Align with adapter resets.
This only makes sense now that the CS IOCTL no longer
returns early on a guilty context.  Without that patch,
this would break userspace.

Reviewed-by: Jesse Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index cd0707737a29b..dd9b649cf88e4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -137,6 +137,8 @@ static enum drm_gpu_sched_stat amdgpu_job_timedout(struct 
drm_sched_job *s_job)
                        s_job->sched->name);
                /* Stop the scheduler to prevent anybody else from touching the 
ring buffer. */
                drm_sched_wqueue_stop(&ring->sched);
+               if (job->vm)
+                       drm_sched_increase_karma(&job->base);
                r = amdgpu_ring_reset(ring, job->vmid, job->hw_fence);
                if (!r) {
                        /* Start the scheduler again */
-- 
2.53.0

Reply via email to