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

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@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Rex Zhu 2016-07-05 19:18:15 +08:00 committed by Alex Deucher
parent ccdbb20a75
commit b1814a1def
1 changed files with 6 additions and 6 deletions

View File

@ -2871,12 +2871,12 @@ static int polaris10_get_evv_voltages(struct pp_hwmgr *hwmgr)
} }
} }
if (atomctrl_get_voltage_evv_on_sclk_ai(hwmgr,
PP_ASSERT_WITH_CODE(0 == atomctrl_get_voltage_evv_on_sclk_ai(hwmgr, VOLTAGE_TYPE_VDDC,
VOLTAGE_TYPE_VDDC, sclk, vv_id, &vddc), sclk, vv_id, &vddc) != 0) {
"Error retrieving EVV voltage value!", printk(KERN_WARNING "failed to retrieving EVV voltage!\n");
continue); continue;
}
/* need to make sure vddc is less than 2v or else, it could burn the ASIC. */ /* need to make sure vddc is less than 2v or else, it could burn the ASIC. */
PP_ASSERT_WITH_CODE((vddc < 2000 && vddc != 0), PP_ASSERT_WITH_CODE((vddc < 2000 && vddc != 0),