diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2021-03-10 12:08:42 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-03-23 23:27:53 -0400 |
commit | 9a9ec6c32caf1e7db32f5d83602a40b345981be1 (patch) | |
tree | 8cc76cf005f28032b828d62f88d78119d4982aa6 /drivers/gpu/drm/amd/pm/powerplay | |
parent | 60d06906cdcdd2127ffd7e6b770ba8ff9d91a5e1 (diff) |
drm/amdgpu/smu8: return an error rather than 50% if busy query fails
For consistency with SMU10.
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/powerplay')
-rw-r--r-- | drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c index 2cef9c0c6d6f..d425b02b1418 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c @@ -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: |