Skip to content

Commit 0c0dd18

Browse files
Rex Zhugregkh
authored andcommitted
drm/amdgpu: Fix vce work queue was not cancelled when suspend
commit 61ea6f5 upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 309a1c5 commit 0c0dd18

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev)
231231
{
232232
int i;
233233

234+
cancel_delayed_work_sync(&adev->vce.idle_work);
235+
234236
if (adev->vce.vcpu_bo == NULL)
235237
return 0;
236238

@@ -241,7 +243,6 @@ int amdgpu_vce_suspend(struct amdgpu_device *adev)
241243
if (i == AMDGPU_MAX_VCE_HANDLES)
242244
return 0;
243245

244-
cancel_delayed_work_sync(&adev->vce.idle_work);
245246
/* TODO: suspending running encoding sessions isn't supported */
246247
return -EINVAL;
247248
}

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

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

158+
cancel_delayed_work_sync(&adev->vcn.idle_work);
159+
158160
if (adev->vcn.vcpu_bo == NULL)
159161
return 0;
160162

161-
cancel_delayed_work_sync(&adev->vcn.idle_work);
162-
163163
size = amdgpu_bo_size(adev->vcn.vcpu_bo);
164164
ptr = adev->vcn.cpu_addr;
165165

0 commit comments

Comments
 (0)