From: Lijo Lazar Date: Fri, 29 Jan 2021 08:24:05 +0000 (+0800) Subject: drm/amd/pm: Correct msg status check for powerlimit X-Git-Tag: v5.15~1144^2~19^2~166 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=debd629a633670527c78f33ab4774899795fc01e;p=platform%2Fkernel%2Flinux-starfive.git 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 --- 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!");