]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/amdgpu: finish delay works before release resources
authorJesse Zhang <zhexi.zhang@amd.com>
Fri, 8 Nov 2019 10:06:07 +0000 (18:06 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 Nov 2019 22:38:13 +0000 (17:38 -0500)
flush/cancel delayed works before doing finalization
to avoid concurrently requests.

Signed-off-by: Jesse Zhang <zhexi.zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c

index 58f6b3b92831b4065b6a3c6568556e9cea50aa30..8ff69a5c232763fe43bef47a143a710cbc51e6c0 100644 (file)
@@ -3110,6 +3110,9 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
 
        DRM_INFO("amdgpu: finishing device.\n");
        adev->shutdown = true;
+
+       flush_delayed_work(&adev->delayed_init_work);
+
        /* disable all interrupts */
        amdgpu_irq_disable_all(adev);
        if (adev->mode_info.mode_config_initialized){
index b4dd89af6f09cf6b1345daacfd6f3d615f4032a2..e324bfe6c58f2f025ac8f724b8aee5d9f8ec2b2f 100644 (file)
@@ -299,6 +299,7 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev)
 {
        int i, j;
 
+       cancel_delayed_work_sync(&adev->uvd.idle_work);
        drm_sched_entity_destroy(&adev->uvd.entity);
 
        for (j = 0; j < adev->uvd.num_uvd_inst; ++j) {
index 703677f2ff6fa5f2ee72dc599bea0e130c3b2f6f..46b590af2fd27c4ea3b8358c533c801b4e901588 100644 (file)
@@ -216,6 +216,7 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev)
        if (adev->vce.vcpu_bo == NULL)
                return 0;
 
+       cancel_delayed_work_sync(&adev->vce.idle_work);
        drm_sched_entity_destroy(&adev->vce.entity);
 
        amdgpu_bo_free_kernel(&adev->vce.vcpu_bo, &adev->vce.gpu_addr,