]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: fix dmub access race condition
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Mon, 21 Jul 2025 15:03:39 +0000 (11:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Aug 2025 18:38:34 +0000 (14:38 -0400)
commitc210b757b400959577a5a17b783b5959b82baed8
tree0752b7e1604ece5450e947227cbbc2a56dcfe5fb
parentfd20627c74993cf4d81e3848f2833c7198c884d7
drm/amd/display: fix dmub access race condition

Accessing DC from amdgpu_dm is usually preceded by acquisition of
dc_lock mutex. Most of the DC API that DM calls are under a DC lock.
However, there are a few that are not. Some DC API called from interrupt
context end up sending DMUB commands via a DC API, while other threads were
using DMUB. This was apparent from a race between calls for setting idle
optimization enable/disable and the DC API to set vmin/vmax.

Offload the call to dc_stream_adjust_vmin_vmax() to a thread instead
of directly calling them from the interrupt handler such that it waits
for dc_lock.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h