drm/amdkfd: Only load sdma mqd when queue is active
authorOak Zeng <Oak.Zeng@amd.com>
Mon, 3 Jun 2019 17:28:13 +0000 (12:28 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jun 2019 17:56:46 +0000 (12:56 -0500)
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 <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

index 00ca3ddb62d7b5efab5c5a3f118f951ea3349539..dab6ef4a52ac2ece9d1d33479fa70807d4a5c0c8 100644 (file)
@@ -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;