aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c4
2 files changed, 4 insertions, 3 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}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index fd654a4406db..400fc74bbae2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -153,11 +153,11 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev)
153 unsigned size; 153 unsigned size;
154 void *ptr; 154 void *ptr;
155 155
156 cancel_delayed_work_sync(&adev->vcn.idle_work);
157
156 if (adev->vcn.vcpu_bo == NULL) 158 if (adev->vcn.vcpu_bo == NULL)
157 return 0; 159 return 0;
158 160
159 cancel_delayed_work_sync(&adev->vcn.idle_work);
160
161 size = amdgpu_bo_size(adev->vcn.vcpu_bo); 161 size = amdgpu_bo_size(adev->vcn.vcpu_bo);
162 ptr = adev->vcn.cpu_addr; 162 ptr = adev->vcn.cpu_addr;
163 163