drm/amdgpu: stop psp ring on suspend
authorEvan Quan <evan.quan@amd.com>
Fri, 8 Sep 2017 05:09:50 +0000 (13:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 12 Sep 2017 18:30:21 +0000 (14:30 -0400)
Otherwise, the ring will fail to create on next resume.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h

index abd2081..0d53052 100644 (file)
@@ -455,6 +455,16 @@ static int psp_hw_fini(void *handle)
 
 static int psp_suspend(void *handle)
 {
+       int ret;
+       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct psp_context *psp = &adev->psp;
+
+       ret = psp_ring_stop(psp, PSP_RING_TYPE__KM);
+       if (ret) {
+               DRM_ERROR("PSP ring stop failed\n");
+               return ret;
+       }
+
        return 0;
 }
 
index e79795b..1b7d12d 100644 (file)
@@ -125,6 +125,7 @@ struct amdgpu_psp_funcs {
 #define psp_prep_cmd_buf(ucode, type) (psp)->prep_cmd_buf((ucode), (type))
 #define psp_ring_init(psp, type) (psp)->ring_init((psp), (type))
 #define psp_ring_create(psp, type) (psp)->ring_create((psp), (type))
+#define psp_ring_stop(psp, type) (psp)->ring_stop((psp), (type))
 #define psp_ring_destroy(psp, type) ((psp)->ring_destroy((psp), (type)))
 #define psp_cmd_submit(psp, ucode, cmd_mc, fence_mc, index) \
                (psp)->cmd_submit((psp), (ucode), (cmd_mc), (fence_mc), (index))