diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-07-31 10:44:31 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-07-31 10:44:31 +0000 |
commit | e1f46e7359e92402fe97a8ce3cf50c6238a0869c (patch) | |
tree | b1aaaa17ab4cae1c9eab1f7abce0d1a5b9e1ac13 | |
parent | 27fc73761c9578780d851508512e9ebabf4d7d70 (diff) |
drm/amdkfd: Fix sdma queue map issue
From Oak Zeng
210dfe6309112dd028bf06561b828a749b6e1169 in linux 4.19.y/4.19.63
065e4bdfa1f3ab2884c110394d8b7e7ebe3b988c in mainline linux
-rw-r--r-- | sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c b/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c index a76132c2fab..3aaf49f0c0b 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -1268,12 +1268,17 @@ int amdkfd_fence_wait_timeout(unsigned int *fence_addr, return 0; } -static int unmap_sdma_queues(struct device_queue_manager *dqm, - unsigned int sdma_engine) +static int unmap_sdma_queues(struct device_queue_manager *dqm) { - return pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_SDMA, - KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0, false, - sdma_engine); + int i, retval = 0; + + for (i = 0; i < dqm->dev->device_info->num_sdma_engines; i++) { + retval = pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_SDMA, + KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0, false, i); + if (retval) + return retval; + } + return retval; } /* dqm->lock mutex has to be locked before calling this function */ @@ -1312,10 +1317,8 @@ static int unmap_queues_cpsch(struct device_queue_manager *dqm, pr_debug("Before destroying queues, sdma queue count is : %u\n", dqm->sdma_queue_count); - if (dqm->sdma_queue_count > 0) { - unmap_sdma_queues(dqm, 0); - unmap_sdma_queues(dqm, 1); - } + if (dqm->sdma_queue_count > 0) + unmap_sdma_queues(dqm); retval = pm_send_unmap_queue(&dqm->packets, KFD_QUEUE_TYPE_COMPUTE, filter, filter_param, false, 0); |