Skip to contentSkip to conversation

drm/amdgpu/swsmu/vangogh: return error if fetching metrics fails

PATCH In review Alex Deucher 2 participants 2 messages Nov 30, 2020 – Dec 1, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/swsmu/vangogh: return error if fetching metrics fails

rather than just dropping the error. Also fixes a set but not used variable warning.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +2 -0
index 3d4d27a304e9..56704181c5a9 100644
@@ -410,6 +410,8 @@ static int vangogh_get_current_activity_percent(struct smu_context *smu,
 		ret = vangogh_get_smu_metrics_data(smu,
 						  METRICS_AVERAGE_GFXACTIVITY,
 						  value);
+		if (ret)
+			return ret;
 		break;
 	default:
 		dev_err(smu->adev->dev, "Invalid sensor for retrieving clock activity\n");
Signature · 6 lines
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - Internal Distribution Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Tuesday, December 1, 2020 6:56 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu/swsmu/vangogh: return error if fetching metrics fails

rather than just dropping the error. Also fixes a set but not used variable warning.

---
 drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c +2 -0
index 3d4d27a304e9..56704181c5a9 100644
@@ -410,6 +410,8 @@ static int vangogh_get_current_activity_percent(struct smu_context *smu,
 ret = vangogh_get_smu_metrics_data(smu,
   METRICS_AVERAGE_GFXACTIVITY,
   value);
+if (ret)
+return ret;
 break;
 default:
 dev_err(smu->adev->dev, "Invalid sensor for retrieving clock activity\n");

--
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cevan.quan%40amd.com%7C5733b7ad8c564980d55008d8958329c8%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637423737869233728%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=PmSi3GKae6vnbF7giI0W9gAKZRywhQO3PcAk7Qhjll0%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx