]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amdkfd: Move queue fs deletion after destroy check
authorKent Russell <kent.russell@amd.com>
Tue, 10 Sep 2024 13:21:25 +0000 (09:21 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Sep 2024 14:04:57 +0000 (10:04 -0400)
We were removing the kernfs entry for queue info before checking if the
queue could be destroyed. If it failed to get destroyed (e.g. during
some GPU resets), then we would try to delete it later during pqm
teardown, but the file was already removed. This led to a kernel WARN
trying to remove size, gpuid and type. Move the remove to after the
destroy check.

Signed-off-by: Kent Russell <kent.russell@amd.com>
Reviewed-by: Jonathan Kim <jonathan.kim@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c

index b439d4d0bd84a5ff041f085bff18e37e1e34a26e..01b960b152743daf8a4f6fb8ae0d49aff4620697 100644 (file)
@@ -517,7 +517,6 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
                if (retval)
                        goto err_destroy_queue;
 
-               kfd_procfs_del_queue(pqn->q);
                dqm = pqn->q->device->dqm;
                retval = dqm->ops.destroy_queue(dqm, &pdd->qpd, pqn->q);
                if (retval) {
@@ -527,6 +526,7 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
                        if (retval != -ETIME)
                                goto err_destroy_queue;
                }
+               kfd_procfs_del_queue(pqn->q);
                kfd_queue_release_buffers(pdd, &pqn->q->properties);
                pqm_clean_queue_resource(pqm, pqn);
                uninit_queue(pqn->q);