The do_aquire_global_lock function was incorrectly returning success (0)
even when wait_for_completion_interruptible_timeout returned 0
(indicating a timeout).

This caused the driver to proceed with atomic updates significantly after
the hardware had hung, leading to system freezes.

Propagate -ETIMEDOUT to correct this behavior.

Signed-off-by: TrainedPro <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 39df45f65..6546bc9f2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -10458,6 +10458,9 @@ static int do_aquire_global_lock(struct drm_device *dev,
                                  crtc->base.id, crtc->name);
 
                drm_crtc_commit_put(commit);
+
+               if (ret == 0)
+                       return -ETIMEDOUT;
        }
 
        return ret < 0 ? ret : 0;
-- 
2.43.0

Reply via email to