]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Fix race in dmub_srv_wait_for_pending
authorDillon Varone <dillon.varone@amd.com>
Mon, 28 Apr 2025 16:34:27 +0000 (12:34 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 May 2025 13:27:36 +0000 (09:27 -0400)
commitdd141b16b3a2979a01194615dfe87dbba9d87045
treee36e860b6ebe610f498f4433e39b43f9be2587e9
parent7ac37f0dcd2e0b729fa7b5513908dc8ab802b540
drm/amd/display: Fix race in dmub_srv_wait_for_pending

[WHY]
If commands are being submitted to DMCUB while concurrently waiting for
pending commands to complete, rptr and wptr may never match again, and
reported command count will not update.

[HOW]
Modify dmub_srv_wait_for_pending to constantly check wptr and rptr
match, and update inbox status whenever a message is sent to avoid the
race and determine message completion or idle as quickly as possible.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Dillon Varone <dillon.varone@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c