]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/powerplay: skip invalid msg when smu set mp1 state
authorLikun Gao <Likun.Gao@amd.com>
Tue, 21 Jul 2020 06:01:53 +0000 (14:01 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Aug 2020 20:26:42 +0000 (16:26 -0400)
Some asic may not support for some message of set mp1 state.
If the return value of smu_send_smc_msg is -EINVAL, that means it failed
to send msg to smc as it can not map an valid message for the ASIC. And
with that case, smu_set_mp1_state should be skipped as those ASIC was in
fact do not support for that.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 6b03f750e63bc83ee04d7671e0543aa153d2fe8d..727cb9fd4aee15c79989d1663797f6d091a34dbb 100644 (file)
@@ -1599,6 +1599,9 @@ int smu_set_mp1_state(struct smu_context *smu,
        }
 
        ret = smu_send_smc_msg(smu, msg, NULL);
+       /* some asics may not support those messages */
+       if (ret == -EINVAL)
+               ret = 0;
        if (ret)
                dev_err(smu->adev->dev, "[PrepareMp1] Failed!\n");