[PATCH] drm/amd/pm: fix warning using uninitialized value of max_vid_step
Huang, Tim
Tim.Huang at amd.com
Mon Apr 29 06:57:53 UTC 2024
[AMD Official Use Only - General]
> -----Original Message-----
> From: Jesse Zhang <jesse.zhang at amd.com>
> Sent: Monday, April 29, 2024 10:29 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Huang, Tim <Tim.Huang at amd.com>; Zhang,
> Jesse(Jie) <Jesse.Zhang at amd.com>; Zhang, Jesse(Jie) <Jesse.Zhang at amd.com>
> Subject: [PATCH] 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
>
> Signed-off-by: Jesse Zhang <Jesse.Zhang at amd.com>
> ---
> drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> 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 b602059436a8..70c711cec897 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
> @@ -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
> + "Failed to get voltage tables!",
> + return result);
> +
> pp_table->MaxVidStep = voltage_table.max_vid_step;
>
> pp_table->GfxDpmVoltageMode =
> --
> 2.25.1
More information about the amd-gfx
mailing list