drm/amd/pm: fix warning using uninitialized value of max_vid_step
Subsystems (3)
PATCH 1/1 drm/amd/pm: fix warning using uninitialized value of max_vid_step
Check the return of pp_atomfwctrl_get_Voltage_table_v4 as it may fail to initialize max_vid_step
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +5 -1
@@ -2573,8 +2573,12 @@ static int vega10_init_smc_table(struct pp_hwmgr *hwmgr) } } -pp_atomfwctrl_get_voltage_table_v4 (hwmgr,VOLTAGE_TYPE_VDDC , + result =pp_atomfwctrl_get_voltage_table_v4 (hwmgr,VOLTAGE_TYPE_VDDC ,VOLTAGE_OBJ_SVID2 , &voltage_table); +PP_ASSERT_WITH_CODE (result <0 , +"Failed to get voltage tables!" , + return result); + pp_table->MaxVidStep = voltage_table.max_vid_step; pp_table->GfxDpmVoltageMode =
Signature · 1 line
2.25.1
[AMD Official Use Only - General]
Quoted 24 lines
-----Original Message-----
From: Jesse Zhang <[email protected]>
Sent: Monday, April 29, 2024 10:29 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Huang, Tim <[email protected]>; Zhang, Jesse(Jie) <[email protected]>; Zhang, Jesse(Jie) <[email protected]>
Subject: [PATCH] drm/amd/pm: fix warning using uninitialized value ofmax_vid_stepCheck the return of
pp_atomfwctrl_get_Voltage_table_v4as it may fail to initializemax_vid_stepSigned-off-by Jesse Zhang <[email protected]>--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +0
-0
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c static int vega10_init_smc_table(struct pp_hwmgr · line 2580
Quoted 9 lines
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +2
-1@@ -2573,8 +2573,12 @@ static int vega10_init_smc_table(struct pp_hwmgr *hwmgr) } } -pp_atomfwctrl_get_voltage_table_v4 (hwmgr,VOLTAGE_TYPE_VDDC , + result =pp_atomfwctrl_get_voltage_table_v4 (hwmgr,VOLTAGE_TYPE_VDDC ,VOLTAGE_OBJ_SVID2 , &voltage_table); + PP_ASSERT_WITH_CODE(result < 0,
Hi jesse,
It should be PP_ASSERT_WITH_CODE(!result, right?
Tim
Quoted 8 lines
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +3
-0+"Failed to get voltage tables!" , + return result); + pp_table->MaxVidStep = voltage_table.max_vid_step;pp_table->GfxDpmVoltageMode =--
2.25.1