Skip to content

Commit 61ea6f5

Browse files
Rex Zhualexdeucher
authored andcommitted
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
1 parent 4fcb7f8 commit 61ea6f5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev)
258258
{
259259
int i;
260260

261+
cancel_delayed_work_sync(&adev->vce.idle_work);
262+
261263
if (adev->vce.vcpu_bo == NULL)
262264
return 0;
263265

@@ -268,7 +270,6 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev)
268270
if (i == AMDGPU_MAX_VCE_HANDLES)
269271
return 0;
270272

271-
cancel_delayed_work_sync(&adev->vce.idle_work);
272273
/* TODO: suspending running encoding sessions isn't supported */
273274
return -EINVAL;
274275
}

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev)
153153
unsigned size;
154154
void *ptr;
155155

156+
cancel_delayed_work_sync(&adev->vcn.idle_work);
157+
156158
if (adev->vcn.vcpu_bo == NULL)
157159
return 0;
158160

159-
cancel_delayed_work_sync(&adev->vcn.idle_work);
160-
161161
size = amdgpu_bo_size(adev->vcn.vcpu_bo);
162162
ptr = adev->vcn.cpu_addr;
163163

0 commit comments

Comments
 (0)