diff options
author | Likun Gao <Likun.Gao@amd.com> | 2019-03-03 21:46:27 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 16:36:48 -0400 |
commit | db65e887fea55ba3e5ce77f7b129a0cde0e1f050 (patch) | |
tree | 49ca7b76182ad65b1d832773fd2ef2439cda353f | |
parent | 24bf582e27a8ac5ffab6c2f1b9541ebaeb250a3d (diff) |
drm/amd/powerplay: fix pcie sysfs interface when set wrong value
The operation of mutex_unlock smu->mutex should be done when forced
level is larger than NUM_LINK_LEVELS in the function of force_clk_levels.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index c66ad3b223d3..b71ecbe66ab4 100644 --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c | |||
@@ -1200,8 +1200,10 @@ static int vega20_force_clk_levels(struct smu_context *smu, | |||
1200 | 1200 | ||
1201 | case PP_PCIE: | 1201 | case PP_PCIE: |
1202 | if (soft_min_level >= NUM_LINK_LEVELS || | 1202 | if (soft_min_level >= NUM_LINK_LEVELS || |
1203 | soft_max_level >= NUM_LINK_LEVELS) | 1203 | soft_max_level >= NUM_LINK_LEVELS) { |
1204 | return -EINVAL; | 1204 | ret = -EINVAL; |
1205 | break; | ||
1206 | } | ||
1205 | 1207 | ||
1206 | ret = smu_send_smc_msg_with_param(smu, | 1208 | ret = smu_send_smc_msg_with_param(smu, |
1207 | SMU_MSG_SetMinLinkDpmByIndex, soft_min_level); | 1209 | SMU_MSG_SetMinLinkDpmByIndex, soft_min_level); |