drm/amdkfd: fix kfd_suspend_all_processes
authorJonathan Kim <jonathan.kim@amd.com>
Fri, 24 Mar 2023 20:19:27 +0000 (16:19 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 16:35:18 +0000 (12:35 -0400)
Flush delayed restore work in kfd_suspend_all_queues instead of
cancelling. Cancelling the work before it runs results in the queues
becoming permanently disabled. Flushing the work ensures that the
queue suspend/resume state stays balanced.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_process.c

index ef67f5e37c6f410dd9ee6a9ebe64396b8a0b1c0d..d75dac92775c78bd1bf6a7aba1a2e176c1048fd0 100644 (file)
@@ -2014,7 +2014,7 @@ void kfd_suspend_all_processes(void)
        WARN(debug_evictions, "Evicting all processes");
        hash_for_each_rcu(kfd_processes_table, temp, p, kfd_processes) {
                cancel_delayed_work_sync(&p->eviction_work);
-               cancel_delayed_work_sync(&p->restore_work);
+               flush_delayed_work(&p->restore_work);
 
                if (kfd_process_evict_queues(p, KFD_QUEUE_EVICTION_TRIGGER_SUSPEND))
                        pr_err("Failed to suspend process 0x%x\n", p->pasid);