]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/sched: Make timeout timer rearm conditional.
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Wed, 12 May 2021 14:26:42 +0000 (10:26 -0400)
committerAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Thu, 20 May 2021 03:50:28 +0000 (23:50 -0400)
We don't want to rearm the timer if driver hook reports
that the device is gone.

v5: Update drm_gpu_sched_stat values in code.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210512142648.666476-11-andrey.grodzovsky@amd.com
drivers/gpu/drm/scheduler/sched_main.c

index f4f474944169c82f2b0c09f37122506fb764ab22..8d1211e87101122778e3a52e1e43566df264fe25 100644 (file)
@@ -314,6 +314,7 @@ static void drm_sched_job_timedout(struct work_struct *work)
 {
        struct drm_gpu_scheduler *sched;
        struct drm_sched_job *job;
+       enum drm_gpu_sched_stat status = DRM_GPU_SCHED_STAT_NOMINAL;
 
        sched = container_of(work, struct drm_gpu_scheduler, work_tdr.work);
 
@@ -331,7 +332,7 @@ static void drm_sched_job_timedout(struct work_struct *work)
                list_del_init(&job->list);
                spin_unlock(&sched->job_list_lock);
 
-               job->sched->ops->timedout_job(job);
+               status = job->sched->ops->timedout_job(job);
 
                /*
                 * Guilty job did complete and hence needs to be manually removed
@@ -345,9 +346,11 @@ static void drm_sched_job_timedout(struct work_struct *work)
                spin_unlock(&sched->job_list_lock);
        }
 
-       spin_lock(&sched->job_list_lock);
-       drm_sched_start_timeout(sched);
-       spin_unlock(&sched->job_list_lock);
+       if (status != DRM_GPU_SCHED_STAT_ENODEV) {
+               spin_lock(&sched->job_list_lock);
+               drm_sched_start_timeout(sched);
+               spin_unlock(&sched->job_list_lock);
+       }
 }
 
  /**