Skip to content

Commit 81cc877

Browse files
Dan Carpenteralexdeucher
authored andcommitted
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: e01eeff ("drm/amd/pm: avoid driver getting empty metrics table for the first time") Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 679fc89 commit 81cc877

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ static int smu_v13_0_6_setup_driver_pptable(struct smu_context *smu)
336336

337337
/* Store one-time values in driver PPTable */
338338
if (!pptable->Init) {
339-
while (retry--) {
339+
while (--retry) {
340340
ret = smu_v13_0_6_get_metrics_table(smu, NULL, true);
341341
if (ret)
342342
return ret;

0 commit comments

Comments
 (0)