Commit b3b18685 authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Deucher

drm/amdgpu: fix retry loop test

This loop will exit with "retry" set to -1 if it fails but the code
checks for if "retry" is zero.  Fix this by changing post-op to a
pre-op.  --retry vs retry--.

Fixes: e01eeffc ("drm/amd/pm: avoid driver getting empty metrics table for the first time")
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b6c22668
...@@ -337,7 +337,7 @@ static int smu_v13_0_6_setup_driver_pptable(struct smu_context *smu) ...@@ -337,7 +337,7 @@ static int smu_v13_0_6_setup_driver_pptable(struct smu_context *smu)
/* Store one-time values in driver PPTable */ /* Store one-time values in driver PPTable */
if (!pptable->Init) { if (!pptable->Init) {
while (retry--) { while (--retry) {
ret = smu_v13_0_6_get_metrics_table(smu, NULL, true); ret = smu_v13_0_6_get_metrics_table(smu, NULL, true);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment