Commit 5e406012 authored by Mukul Joshi's avatar Mukul Joshi Committed by Alex Deucher

drm/amdkfd: Call DQM stop during DQM uninitialize

During DQM tear down, call DQM stop to unitialize HIQ and
associated memory allocated during packet manager init.
Signed-off-by: default avatarMukul Joshi <mukul.joshi@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 21e1217b
...@@ -1348,9 +1348,16 @@ static int start_nocpsch(struct device_queue_manager *dqm) ...@@ -1348,9 +1348,16 @@ static int start_nocpsch(struct device_queue_manager *dqm)
static int stop_nocpsch(struct device_queue_manager *dqm) static int stop_nocpsch(struct device_queue_manager *dqm)
{ {
dqm_lock(dqm);
if (!dqm->sched_running) {
dqm_unlock(dqm);
return 0;
}
if (dqm->dev->adev->asic_type == CHIP_HAWAII) if (dqm->dev->adev->asic_type == CHIP_HAWAII)
pm_uninit(&dqm->packet_mgr, false); pm_uninit(&dqm->packet_mgr, false);
dqm->sched_running = false; dqm->sched_running = false;
dqm_unlock(dqm);
return 0; return 0;
} }
...@@ -2423,6 +2430,7 @@ static void deallocate_hiq_sdma_mqd(struct kfd_node *dev, ...@@ -2423,6 +2430,7 @@ static void deallocate_hiq_sdma_mqd(struct kfd_node *dev,
void device_queue_manager_uninit(struct device_queue_manager *dqm) void device_queue_manager_uninit(struct device_queue_manager *dqm)
{ {
dqm->ops.stop(dqm);
dqm->ops.uninitialize(dqm); dqm->ops.uninitialize(dqm);
if (!dqm->dev->kfd->shared_resources.enable_mes) if (!dqm->dev->kfd->shared_resources.enable_mes)
deallocate_hiq_sdma_mqd(dqm->dev, &dqm->hiq_sdma_mqd); deallocate_hiq_sdma_mqd(dqm->dev, &dqm->hiq_sdma_mqd);
......
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