change guarantees that gfxoff is allowed before moving further in
s2idle sequence to add more reliablity about gfxoff in amdgpu IP's
suspend flow

Signed-off-by: Harsh Jain <[email protected]>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 222d3d7ea076..5b2afe348c23 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -581,11 +581,11 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool 
enable)
 
                if (adev->gfx.gfx_off_req_count == 0 &&
                    !adev->gfx.gfx_off_state) {
-                       /* If going to s2idle, no need to wait */
-                       if (adev->in_s0ix)
-                               delay = GFX_OFF_NO_DELAY;
                        schedule_delayed_work(&adev->gfx.gfx_off_delay_work,
                                              delay);
+                       /* If going to s2idle, no need to wait */
+                       if (adev->in_s0ix)
+                               
flush_delayed_work(&adev->gfx.gfx_off_delay_work);
                }
        } else {
                if (adev->gfx.gfx_off_req_count == 0) {
-- 
2.25.1

Reply via email to