Skip to contentSkip to conversation

drm/amd/powerplay: fix pcie sysfs interface when set wrong value

PATCH In review likun Gao 2 participants 2 messages Mar 4, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

likun Gao

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: fix pcie sysfs interface when set wrong value

From: Likun Gao <[email protected]>

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.

---
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +4 -2
index f7188a7..4b1fc45 100644
@@ -1206,8 +1206,10 @@ static int vega20_force_clk_levels(struct smu_context *smu,
 
 	case PP_PCIE:
 		if (soft_min_level >= NUM_LINK_LEVELS ||
-		    soft_max_level >= NUM_LINK_LEVELS)
-			return -EINVAL;
+		    soft_max_level >= NUM_LINK_LEVELS) {
+			ret = -EINVAL;
+			break;
+		}
 
 		ret = smu_send_smc_msg_with_param(smu,
 				SMU_MSG_SetMinLinkDpmByIndex, soft_min_level);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1551671269-30697-1-git-send-email-likun.gao-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 6 lines · likun Gao

From: Likun Gao <[email protected]>

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.

Quoted 28 lines
---
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +4 -2
index f7188a7..4b1fc45 100644
@@ -1206,8 +1206,10 @@ static int vega20_force_clk_levels(struct smu_context *smu,
 
 	case PP_PCIE:
 		if (soft_min_level >= NUM_LINK_LEVELS ||
-		    soft_max_level >= NUM_LINK_LEVELS)
-			return -EINVAL;
+		    soft_max_level >= NUM_LINK_LEVELS) {
+			ret = -EINVAL;
+			break;
+		}
 
 		ret = smu_send_smc_msg_with_param(smu,
 				SMU_MSG_SetMinLinkDpmByIndex, soft_min_level);
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx