drm/amdgpu: Cancel gfx off delay work when driver fini/suspend
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 9 Aug 2018 07:26:06 +0000 (15:26 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:10:12 +0000 (11:10 -0500)
there may be gfx off delay work pending when suspend/driver
unload, need to cancel them first.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 6d0ffbf5b3377253e5bb4830f9baba09a180fef7..99a0e478499b339a8587be1fde0679ca6414428c 100644 (file)
@@ -1829,6 +1829,7 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
                                return r;
                        }
                        amdgpu_gfx_off_ctrl(adev, false);
+                       cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);
                        r = adev->ip_blocks[i].version->funcs->hw_fini((void *)adev);
                        /* XXX handle errors */
                        if (r) {
@@ -2012,6 +2013,7 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
 
        /* call smu to disable gfx off feature first when suspend */
        amdgpu_gfx_off_ctrl(adev, false);
+       cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work);
 
        for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
                if (!adev->ip_blocks[i].status.valid)