drm/amd/display: Add guards for idle on reg read/write
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Fri, 16 Feb 2024 19:42:05 +0000 (14:42 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 20 Mar 2024 17:37:37 +0000 (13:37 -0400)
commitf57269f85b284f3a8154e208d7b1eb2abe652eb2
treeab800ffd4d1072ab7fd3a096a4d850fa38e64355
parent97d5aa60306d286326026a40e1e3b992b5b31538
drm/amd/display: Add guards for idle on reg read/write

[WHY]
If DCN is in idle then we should not be accessing DCN registers or
it can lead to hangs.

[HOW]
Log the error and return 0 or drop the write if it's in idle.

This is skipped in the exit sequence itself since the boolean flips
before it starts.

It also does not cover accesses from external clients outside of DM/DC
like firmware or the kernel mode driver.

Reviewed-by: Duncan Ma <duncan.ma@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@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/dc/dc_dmub_srv.h