Commit 8c07f33e authored by Philip Yang's avatar Philip Yang Committed by Alex Deucher

Revert "drm/amdkfd: Free queue after unmap queue success"

This reverts commit ab8529b0.

This causes KFDTest KFDMemoryTest.MemoryRegister test failed on gfx9.
Signed-off-by: default avatarPhilip Yang <Philip.Yang@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1c4dae3e
...@@ -1881,22 +1881,6 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm, ...@@ -1881,22 +1881,6 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,
} }
if (q->properties.is_active) {
if (!dqm->dev->shared_resources.enable_mes) {
retval = execute_queues_cpsch(dqm,
KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
if (retval == -ETIME)
qpd->reset_wavefronts = true;
} else {
retval = remove_queue_mes(dqm, q, qpd);
}
if (retval)
goto failed_unmap_queue;
decrement_queue_count(dqm, qpd, q);
}
mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type( mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type(
q->properties.type)]; q->properties.type)];
...@@ -1910,6 +1894,17 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm, ...@@ -1910,6 +1894,17 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,
list_del(&q->list); list_del(&q->list);
qpd->queue_count--; qpd->queue_count--;
if (q->properties.is_active) {
if (!dqm->dev->shared_resources.enable_mes) {
decrement_queue_count(dqm, qpd, q);
retval = execute_queues_cpsch(dqm,
KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
if (retval == -ETIME)
qpd->reset_wavefronts = true;
} else {
retval = remove_queue_mes(dqm, q, qpd);
}
}
/* /*
* Unconditionally decrement this counter, regardless of the queue's * Unconditionally decrement this counter, regardless of the queue's
...@@ -1926,7 +1921,6 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm, ...@@ -1926,7 +1921,6 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,
return retval; return retval;
failed_unmap_queue:
failed_try_destroy_debugged_queue: failed_try_destroy_debugged_queue:
dqm_unlock(dqm); dqm_unlock(dqm);
......
...@@ -422,6 +422,7 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid) ...@@ -422,6 +422,7 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
} }
if (pqn->q) { if (pqn->q) {
kfd_procfs_del_queue(pqn->q);
dqm = pqn->q->device->dqm; dqm = pqn->q->device->dqm;
retval = dqm->ops.destroy_queue(dqm, &pdd->qpd, pqn->q); retval = dqm->ops.destroy_queue(dqm, &pdd->qpd, pqn->q);
if (retval) { if (retval) {
...@@ -445,7 +446,6 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid) ...@@ -445,7 +446,6 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid)
amdgpu_amdkfd_free_gtt_mem(dev->adev, pqn->q->wptr_bo); amdgpu_amdkfd_free_gtt_mem(dev->adev, pqn->q->wptr_bo);
} }
kfd_procfs_del_queue(pqn->q);
uninit_queue(pqn->q); uninit_queue(pqn->q);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment