drm/amdgpu/smu8: return an error rather than 50% if busy query fails
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Mar 2021 17:08:42 +0000 (12:08 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Mar 2021 03:27:53 +0000 (23:27 -0400)
For consistency with SMU10.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c

index 2cef9c0c6d6f4bdef7bf125e1ffe1a0f2d0cfeed..d425b02b1418f5fedbdd0b421d206edeb4120a11 100644 (file)
@@ -1788,11 +1788,10 @@ static int smu8_read_sensor(struct pp_hwmgr *hwmgr, int idx,
                result = smum_send_msg_to_smc(hwmgr,
                                PPSMC_MSG_GetAverageGraphicsActivity,
                                &activity_percent);
-               if (0 == result) {
+               if (0 == result)
                        activity_percent = activity_percent > 100 ? 100 : activity_percent;
-               } else {
-                       activity_percent = 50;
-               }
+               else
+                       return -EIO;
                *((uint32_t *)value) = activity_percent;
                return 0;
        case AMDGPU_PP_SENSOR_UVD_POWER: