drm/amd/powerplay: check before issuing messages for max sustainable clocks
authorEvan Quan <evan.quan@amd.com>
Tue, 6 Aug 2019 08:14:22 +0000 (16:14 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Aug 2019 18:53:13 +0000 (13:53 -0500)
Those messages are not supported on Arcturus and should not be
issued.

Affected ASIC: Arcturus

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

index ee739c080943135d96e5e3cc1670ff6172d0d4fe..8c4d3ee0295a942dc1f9694cf8e96e7536f190cd 100644 (file)
@@ -908,6 +908,10 @@ smu_v11_0_get_max_sustainable_clock(struct smu_context *smu, uint32_t *clock,
        if (!smu->pm_enabled)
                return ret;
 
+       if ((smu_msg_get_index(smu, SMU_MSG_GetDcModeMaxDpmFreq) < 0) ||
+           (smu_msg_get_index(smu, SMU_MSG_GetMaxDpmFreq) < 0))
+               return 0;
+
        clk_id = smu_clk_get_index(smu, clock_select);
        if (clk_id < 0)
                return -EINVAL;