From debd629a633670527c78f33ab4774899795fc01e Mon Sep 17 00:00:00 2001 From: Lijo Lazar Date: Fri, 29 Jan 2021 16:24:05 +0800 Subject: [PATCH] drm/amd/pm: Correct msg status check for powerlimit Status 0 indicates success, fix the check before using PPTable limit Signed-off-by: Lijo Lazar Reviewed-by: Evan Quan Reviewed-by: Kevin Wang ` Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c index 6295238..df94604 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c @@ -1072,7 +1072,7 @@ static int aldebaran_get_power_limit(struct smu_context *smu) ret = smu_cmn_send_smc_msg(smu, SMU_MSG_GetPptLimit, &power_limit); - if (!ret) { + if (ret) { /* the last hope to figure out the ppt limit */ if (!pptable) { dev_err(smu->adev->dev, "Cannot get PPT limit due to pptable missing!"); -- 2.7.4