aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-09-27 08:48:39 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-09-27 11:01:20 -0400
commit61ea6f5831974ebd1a57baffd7cc30600a2e26fc (patch)
tree2be665d921f615477bc8d83b06a462110df9cc3c /drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
parent4fcb7f8be829d21bcbb24eef2204fb6b34ed1f80 (diff)
drm/amdgpu: Fix vce work queue was not cancelled when suspend
The vce cancel_delayed_work_sync never be called. driver call the function in error path. This caused the A+A suspend hang when runtime pm enebled. As we will visit the smu in the idle queue. this will cause smu hang because the dgpu has been suspend, and the dgpu also will be waked up. As the smu has been hang, so the dgpu resume will failed. Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Feifei Xu <Feifei.Xu@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
index 0cc5190f4f36..5f3f54073818 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
@@ -258,6 +258,8 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev)
258{ 258{
259 int i; 259 int i;
260 260
261 cancel_delayed_work_sync(&adev->vce.idle_work);
262
261 if (adev->vce.vcpu_bo == NULL) 263 if (adev->vce.vcpu_bo == NULL)
262 return 0; 264 return 0;
263 265
@@ -268,7 +270,6 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev)
268 if (i == AMDGPU_MAX_VCE_HANDLES) 270 if (i == AMDGPU_MAX_VCE_HANDLES)
269 return 0; 271 return 0;
270 272
271 cancel_delayed_work_sync(&adev->vce.idle_work);
272 /* TODO: suspending running encoding sessions isn't supported */ 273 /* TODO: suspending running encoding sessions isn't supported */
273 return -EINVAL; 274 return -EINVAL;
274} 275}