[PATCH 2/2] drm/amdgpu/smu8: return an error rather than 50% if busy query fails

Quan, Evan Evan.Quan at amd.com
Thu Mar 11 01:44:17 UTC 2021


[AMD Public Use]



-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Thursday, March 11, 2021 1:12 AM
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
Subject: [PATCH 2/2] drm/amdgpu/smu8: return an error rather than 50% if busy query fails

For consistency with SMU10.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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..e64c6ff75b44 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
@@ -1791,7 +1791,7 @@ static int smu8_read_sensor(struct pp_hwmgr *hwmgr, int idx,
 		if (0 == result) {
 			activity_percent = activity_percent > 100 ? 100 : activity_percent;
 		} else {
-			activity_percent = 50;
+			return -EIO;
 		}
[Quan, Evan] nitpick: you can drop the { } around if/else. Anyway the series is reviewed-by: Evan Quan <evan.quan at amd.com>
 		*((uint32_t *)value) = activity_percent;
 		return 0;
-- 
2.29.2

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cevan.quan%40amd.com%7C18cbbd8ebfff487b22f008d8e3e79de9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637509931222610662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=pUtV%2B%2BCOkH%2FWKBCmjzwQYuIREazNbkHxInbh973i0Do%3D&reserved=0


More information about the amd-gfx mailing list