[PATCH] drm/amd/powerplay: don't add invalid voltage.

Rex Zhu Rex.Zhu at amd.com
Tue Jul 5 11:26:27 UTC 2016


if atomctrl_get_voltage_evv_on_sclk_ai returns non zero (fail) in the expansion
of the PP_ASSERT_WITH_CODE macro the continue will actually do nothing
So invalid voltage will be added to ppbable.

Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>

Change-Id: I2ba90baab6d5e5459d68a9ee926157d29fad93a1
---
 drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
index 38f5549..5370c0f 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c
@@ -2897,12 +2897,11 @@ static int polaris10_get_evv_voltages(struct pp_hwmgr *hwmgr)
 				}
 			}
 
-
-			PP_ASSERT_WITH_CODE(0 == atomctrl_get_voltage_evv_on_sclk_ai(hwmgr,
-							VOLTAGE_TYPE_VDDC, sclk, vv_id, &vddc),
-						"Error retrieving EVV voltage value!",
-						continue);
-
+			if (0 != atomctrl_get_voltage_evv_on_sclk_ai(hwmgr,
+							VOLTAGE_TYPE_VDDC, sclk, vv_id, &vddc)) {
+				printk("Error retrieving EVV voltage value!\n");
+				continue;
+			}
 
 			/* need to make sure vddc is less than 2v or else, it could burn the ASIC.
 			 * real voltage level in unit of 0.01mv */
-- 
1.9.1



More information about the amd-gfx mailing list