Skip to content

Commit 9f87516

Browse files
JesseZhang1alexdeucher
authored andcommitted
drm/amd/amdgpu: finish delay works before release resources
flush/cancel delayed works before doing finalization to avoid concurrently requests. Signed-off-by: Jesse Zhang <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 4cae34d commit 9f87516

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,6 +3110,9 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
31103110

31113111
DRM_INFO("amdgpu: finishing device.\n");
31123112
adev->shutdown = true;
3113+
3114+
flush_delayed_work(&adev->delayed_init_work);
3115+
31133116
/* disable all interrupts */
31143117
amdgpu_irq_disable_all(adev);
31153118
if (adev->mode_info.mode_config_initialized){

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
299299
{
300300
int i, j;
301301

302+
cancel_delayed_work_sync(&adev->uvd.idle_work);
302303
drm_sched_entity_destroy(&adev->uvd.entity);
303304

304305
for (j = 0; j < adev->uvd.num_uvd_inst; ++j) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev)
216216
if (adev->vce.vcpu_bo == NULL)
217217
return 0;
218218

219+
cancel_delayed_work_sync(&adev->vce.idle_work);
219220
drm_sched_entity_destroy(&adev->vce.entity);
220221

221222
amdgpu_bo_free_kernel(&adev->vce.vcpu_bo, &adev->vce.gpu_addr,

0 commit comments

Comments
 (0)