]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/amdgpu: do not free fence buf when driver probes.
authorHuang Rui <ray.huang@amd.com>
Mon, 10 Apr 2017 07:29:42 +0000 (15:29 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 28 Apr 2017 21:32:12 +0000 (17:32 -0400)
Fence buf needs to be used on suspend/resume phase.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index 68ccaedad0f7531031ae1a8c8d90589856db3709..19180aaa8bf273b3f948b84aaec2a57d967fa96a 100644 (file)
@@ -358,8 +358,6 @@ static int psp_load_fw(struct amdgpu_device *adev)
        if (ret)
                goto failed_mem;
 
-       amdgpu_bo_free_kernel(&psp->fence_buf_bo,
-                             &psp->fence_buf_mc_addr, &psp->fence_buf);
        kfree(cmd);
 
        return 0;
@@ -423,6 +421,10 @@ static int psp_hw_fini(void *handle)
                amdgpu_bo_free_kernel(&psp->fw_pri_bo,
                                      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
 
+       if (psp->fence_buf_bo)
+               amdgpu_bo_free_kernel(&psp->fence_buf_bo,
+                                     &psp->fence_buf_mc_addr, &psp->fence_buf);
+
        return 0;
 }