Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1814a1d authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher
Browse files

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: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ccdbb20a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2871,12 +2871,12 @@ 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 (atomctrl_get_voltage_evv_on_sclk_ai(hwmgr,
						VOLTAGE_TYPE_VDDC,
						sclk, vv_id, &vddc) != 0) {
				printk(KERN_WARNING "failed to retrieving EVV voltage!\n");
				continue;
			}

			/* need to make sure vddc is less than 2v or else, it could burn the ASIC. */
			PP_ASSERT_WITH_CODE((vddc < 2000 && vddc != 0),