]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Use lockdep_assert_held() for dc_lock check
authorRay Wu <ray.wu@amd.com>
Mon, 4 May 2026 06:32:13 +0000 (14:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 May 2026 15:45:41 +0000 (11:45 -0400)
[Why]
mutex_is_locked() only tells whether *some* task holds the mutex, not
the current one, so the existing ASSERT can silently pass when the
caller violates the contract.

[How]
Use the kernel's lockdep debugging utility (include/linux/lockdep.h)
and replace ASSERT(mutex_is_locked(&dm->dc_lock)) with
lockdep_assert_held(&dm->dc_lock), which checks the current task's
held-lock stack.

Reviewed-by: Sun peng (Leo) Li <sunpeng.li@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c

index 73eda7273a7bd6ede74e8e5889bb0af35af2fb66..7dcc587c45e91e508c0d0a7bd1b343a68461fb34 100644 (file)
@@ -451,8 +451,8 @@ void amdgpu_dm_ism_commit_event(struct amdgpu_dm_ism *ism,
        struct amdgpu_display_manager *dm = &adev->dm;
        struct dm_crtc_state *acrtc_state = to_dm_crtc_state(acrtc->base.state);
 
-       /* ISM transitions must be called with mutex acquired */
-       ASSERT(mutex_is_locked(&dm->dc_lock));
+       /* ISM transitions must be called with dc_lock held */
+       lockdep_assert_held(&dm->dc_lock);
 
        /* ISM should not run after dc is destroyed */
        ASSERT(dm->dc);