Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdkfd: Move queue fs deletion after destroy check

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>

authored by

Kent Russell and committed by
Alex Deucher
21d1d724 ae2c6d8b

+1 -1
+1 -1
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
··· 517 517 if (retval) 518 518 goto err_destroy_queue; 519 519 520 - kfd_procfs_del_queue(pqn->q); 521 520 dqm = pqn->q->device->dqm; 522 521 retval = dqm->ops.destroy_queue(dqm, &pdd->qpd, pqn->q); 523 522 if (retval) { ··· 526 527 if (retval != -ETIME) 527 528 goto err_destroy_queue; 528 529 } 530 + kfd_procfs_del_queue(pqn->q); 529 531 kfd_queue_release_buffers(pdd, &pqn->q->properties); 530 532 pqm_clean_queue_resource(pqm, pqn); 531 533 uninit_queue(pqn->q);