drm/amd/pp: Clear smu response register before send smu message
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 11 Apr 2018 10:11:49 +0000 (18:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:43:18 +0000 (13:43 -0500)
smu firmware do not update response register immediately under
some delay tasks, we may read out the original value.

so need to clear the register before send smu message.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c

index 2a93f3a8e4f035f6f0a7dd66b19f3c47d0858b8d..2d4ec8ac3a088c3ff7f1340030e5764854245a2c 100644 (file)
@@ -208,9 +208,7 @@ static int ci_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)
 {
        int ret;
 
-       if (!ci_is_smc_ram_running(hwmgr))
-               return -EINVAL;
-
+       cgs_write_register(hwmgr->device, mmSMC_RESP_0, 0);
        cgs_write_register(hwmgr->device, mmSMC_MESSAGE_0, msg);
 
        PHM_WAIT_FIELD_UNEQUAL(hwmgr, SMC_RESP_0, SMC_RESP, 0);
index 10a112376fd1c386032e3b571be0904a2f64388e..64d33b775906c3a945d3484418545fbbbfdd7dce 100644 (file)
@@ -176,6 +176,7 @@ int smu7_send_msg_to_smc(struct pp_hwmgr *hwmgr, uint16_t msg)
        else if (ret != 1)
                pr_info("\n last message was failed ret is %d\n", ret);
 
+       cgs_write_register(hwmgr->device, mmSMC_RESP_0, 0);
        cgs_write_register(hwmgr->device, mmSMC_MESSAGE_0, msg);
 
        PHM_WAIT_FIELD_UNEQUAL(hwmgr, SMC_RESP_0, SMC_RESP, 0);