drm/amdgpu: fix reboot failure issue for virtualization
authorXiangliang Yu <Xiangliang.Yu@amd.com>
Wed, 18 Jan 2017 04:47:55 +0000 (12:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 16:13:39 +0000 (11:13 -0500)
Reboot process will call HW fini functions of IP blocks. For virt,
need to send event three before hw fini and send event four after
hw fini.

Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
Reviewed-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index b408a54638a4e5fb01b206da50e2f4fac33b5899..786c3c3bb48de4b73b632c34f46d571fa452d780 100644 (file)
@@ -1565,6 +1565,9 @@ int amdgpu_suspend(struct amdgpu_device *adev)
 {
        int i, r;
 
+       if (amdgpu_sriov_vf(adev))
+               amdgpu_virt_request_full_gpu(adev, false);
+
        /* ungate SMC block first */
        r = amdgpu_set_clockgating_state(adev, AMD_IP_BLOCK_TYPE_SMC,
                                         AMD_CG_STATE_UNGATE);
@@ -1593,6 +1596,9 @@ int amdgpu_suspend(struct amdgpu_device *adev)
                }
        }
 
+       if (amdgpu_sriov_vf(adev))
+               amdgpu_virt_release_full_gpu(adev, false);
+
        return 0;
 }