summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
diff options
context:
space:
mode:
authorWenhui Sheng <Wenhui.Sheng@amd.com>2020-05-22 12:30:58 +0800
committerAlex Deucher <alexander.deucher@amd.com>2020-05-28 14:00:50 -0400
commit4ea5081c82c422433e7c6245e0f1cc2b49838451 (patch)
treea8bf530b6c5539f684c29bc914a2ba28bc46d914 /drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
parentd4f3c0b3325413193ddd996fbb495f1d09250583 (diff)
drm/amd/powerplay: enable SMC message filter
1. enable SMC message filter in SRIOV situation 2. return -EACCESS if msg is blocked from smu_msg_get_index 3. if msg is block, always return 0 from smu_v11_0_send_msg_with_param Signed-off-by: Wenhui Sheng <Wenhui.Sheng@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/arcturus_ppt.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/arcturus_ppt.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
index fad6f3a60dc9..dcbb273674d1 100644
--- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
@@ -208,6 +208,9 @@ static int arcturus_get_smu_msg_index(struct smu_context *smc, uint32_t index)
if (!(mapping.valid_mapping))
return -EINVAL;
+ if (amdgpu_sriov_vf(smc->adev) && !mapping.valid_in_vf)
+ return -EACCES;
+
return mapping.map_to;
}
@@ -382,11 +385,6 @@ arcturus_set_single_dpm_table(struct smu_context *smu,
return ret;
}
- if (!num_of_levels) {
- pr_err("[%s] number of clk levels is invalid!\n", __func__);
- return -EINVAL;
- }
-
single_dpm_table->count = num_of_levels;
for (i = 0; i < num_of_levels; i++) {
ret = smu_send_smc_msg_with_param(smu,
@@ -397,10 +395,6 @@ arcturus_set_single_dpm_table(struct smu_context *smu,
pr_err("[%s] failed to get dpm freq by index!\n", __func__);
return ret;
}
- if (!clk) {
- pr_err("[%s] clk value is invalid!\n", __func__);
- return -EINVAL;
- }
single_dpm_table->dpm_levels[i].value = clk;
single_dpm_table->dpm_levels[i].enabled = true;
}