AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu/pm: Fix uninitialized variable agc_btc_response
@ 2024-04-28  9:54 Ma Jun
  2024-04-28  9:54 ` [PATCH 2/2] drm/amdgpu/pm: Fix uninitialized variable warning Ma Jun
  0 siblings, 1 reply; 6+ messages in thread
From: Ma Jun @ 2024-04-28  9:54 UTC (permalink / raw)
  To: amd-gfx
  Cc: Kenneth.Feng, Alexander.Deucher, kevinyang.wang, christian.koenig,
	Ma Jun

Assign an default value to agc_btc_response in failed case

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
index 9f5bd998c6bf..74a33b9ace6c 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
@@ -2350,15 +2350,20 @@ static int vega10_acg_enable(struct pp_hwmgr *hwmgr)
 {
 	struct vega10_hwmgr *data = hwmgr->backend;
 	uint32_t agc_btc_response;
+	int ret;
 
 	if (data->smu_features[GNLD_ACG].supported) {
 		if (0 == vega10_enable_smc_features(hwmgr, true,
 					data->smu_features[GNLD_DPM_PREFETCHER].smu_feature_bitmap))
 			data->smu_features[GNLD_DPM_PREFETCHER].enabled = true;
 
-		smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitializeAcg, NULL);
+		ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_InitializeAcg, NULL);
+		if (ret)
+			return ret;
 
-		smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc, &agc_btc_response);
+		ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc, &agc_btc_response);
+		if (ret)
+			agc_btc_response = 0;
 
 		if (1 == agc_btc_response) {
 			if (1 == data->acg_loop_state)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-30 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-28  9:54 [PATCH 1/2] drm/amdgpu/pm: Fix uninitialized variable agc_btc_response Ma Jun
2024-04-28  9:54 ` [PATCH 2/2] drm/amdgpu/pm: Fix uninitialized variable warning Ma Jun
2024-04-28 14:18   ` Alex Deucher
2024-04-29  3:42     ` Ma, Jun
2024-04-29  2:44   ` Wang, Yang(Kevin)
2024-04-30 12:52   ` Wang, Yang(Kevin)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox