From: Oak Zeng Date: Mon, 3 Jun 2019 17:28:13 +0000 (-0500) Subject: drm/amdkfd: Only load sdma mqd when queue is active X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2ff528190f5cc8b326260ee030cf2eda73bdb78d;p=openwrt%2Fstaging%2Fblogic.git drm/amdkfd: Only load sdma mqd when queue is active Also calls load_mqd with current->mm struct. The mm struct is used to read back user wptr of the queue. Signed-off-by: Oak Zeng Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 00ca3ddb62d7..dab6ef4a52ac 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -995,8 +995,11 @@ static int create_sdma_queue_nocpsch(struct device_queue_manager *dqm, if (retval) goto out_deallocate_doorbell; + if (!q->properties.is_active) + return 0; + retval = mqd_mgr->load_mqd(mqd_mgr, q->mqd, 0, 0, &q->properties, - NULL); + current->mm); if (retval) goto out_uninit_mqd;