]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amd/amdkfd: Don't sent command to HWS on kfd reset
authorshaoyunl <shaoyun.liu@amd.com>
Wed, 3 Nov 2021 14:49:47 +0000 (10:49 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Nov 2021 18:12:38 +0000 (14:12 -0400)
When kfd need to be reset, sent command to HWS might cause hang and get unnecessary timeout.
This change try not to touch HW in pre_reset and keep queues to be in the evicted state
when the reset is done, so they are not put back on the runlist. These queues will be destroied
on process termination.

Signed-off-by: shaoyunl <shaoyun.liu@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_device_queue_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_process.c

index 533b27b35fc987469e8cf1231219baeadb2846d3..003ba6a373ff459a050af89fcd3564e6d6837bc1 100644 (file)
@@ -1430,7 +1430,7 @@ static int unmap_queues_cpsch(struct device_queue_manager *dqm,
 
        if (!dqm->sched_running)
                return 0;
-       if (dqm->is_hws_hang)
+       if (dqm->is_hws_hang || dqm->is_resetting)
                return -EIO;
        if (!dqm->active_runlist)
                return retval;
index 457863861d6f37ddfb1986d117742ba7e3a55543..b993011cfa64a8ca18aac32df66480bcc5b2bc0b 100644 (file)
@@ -1715,7 +1715,11 @@ int kfd_process_evict_queues(struct kfd_process *p)
 
                r = pdd->dev->dqm->ops.evict_process_queues(pdd->dev->dqm,
                                                            &pdd->qpd);
-               if (r) {
+               /* evict return -EIO if HWS is hang or asic is resetting, in this case
+                * we would like to set all the queues to be in evicted state to prevent
+                * them been add back since they actually not be saved right now.
+                */
+               if (r && r != -EIO) {
                        pr_err("Failed to evict process queues\n");
                        goto fail;
                }