drm/amd/pm: Correct msg status check for powerlimit
authorLijo Lazar <lijo.lazar@amd.com>
Fri, 29 Jan 2021 08:24:05 +0000 (16:24 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Mar 2021 02:58:21 +0000 (22:58 -0400)
Status 0 indicates success, fix the check before using PPTable limit

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>`
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c

index 6295238..df94604 100644 (file)
@@ -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!");