]> www.infradead.org Git - users/dwmw2/linux.git/commit
drm/amd/pm: Ignore initial value in smu response register
authorDanijel Slivka <danijel.slivka@amd.com>
Fri, 5 Jul 2024 12:15:32 +0000 (14:15 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Jul 2024 14:12:37 +0000 (10:12 -0400)
commit708f220567d4a398ee1553ee6519f7e73ae5ed6c
tree9b15d455fc98f45b1e8c8b31392c3f29d9675508
parentd02ddefc7eedaa6394279bad522c70fd5d63e163
drm/amd/pm: Ignore initial value in smu response register

Why:
If the reg mmMP1_SMN_C2PMSG_90 is being written to during amdgpu driver
load or driver unload, subsequent amdgpu driver load will fail at
smu_hw_init. The default of mmMP1_SMN_C2PMSG_90 register at a clean
environment is 0x1 and if value differs from expected, amdgpu driver
load will fail.

How to fix:
Ignore the initial value in smu response register before the first smu
message is sent,if smc in SMU_FW_INIT state, just proceed further to
send the message. If register holds an unexpected value after smu message
was sent set, smc_state to SMU_FW_HANG state and no further smu messages
will be sent.

v2:
Set SMU_FW_INIT state at the start of smu hw_init/resume.
Check smc_fw_state before sending smu message if in hang state skip
sending message.
Set SMU_FW_HANG only in case unexpected value is detected

Signed-off-by: Danijel Slivka <danijel.slivka@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c