[PATCH] drm/amd/display: Initialize 'wait_time_microsec' variable in link_dp_training_dpia.c

Li, Roman Roman.Li at amd.com
Fri Feb 9 15:20:58 UTC 2024


[Public]

Reviewed-by: Roman Li <roman.li at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
> Srinivasan Shanmugam
> Sent: Tuesday, February 6, 2024 11:55 PM
> To: Siqueira, Rodrigo <Rodrigo.Siqueira at amd.com>; Pillai, Aurabindo
> <Aurabindo.Pillai at amd.com>
> Cc: amd-gfx at lists.freedesktop.org; SHANMUGAM, SRINIVASAN
> <SRINIVASAN.SHANMUGAM at amd.com>; Liu, Wenjing
> <Wenjing.Liu at amd.com>
> Subject: [PATCH] drm/amd/display: Initialize 'wait_time_microsec' variable in
> link_dp_training_dpia.c
>
> wait_time_microsec = max(wait_time_microsec, (uint32_t)
> DPIA_CLK_SYNC_DELAY);
>
> Above line is trying to assign the maximum value between
> 'wait_time_microsec' and 'DPIA_CLK_SYNC_DELAY' to wait_time_microsec.
> However, 'wait_time_microsec' has not been assigned a value before this line,
> initialize 'wait_time_microsec' at the point of declaration.
>
> Fixes the below:
> drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dp_training
> _dpia.c:697 dpia_training_eq_non_transparent() error: uninitialized symbol
> 'wait_time_microsec'.
>
> Fixes: 630168a97314 ("drm/amd/display: move dp link training logic to
> link_dp_training")
> Cc: Wenjing Liu <wenjing.liu at amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
>  .../drm/amd/display/dc/link/protocols/link_dp_training_dpia.c   | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
> a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.c
> b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.c
> index e8dda44b23cb..5d36bab0029c 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpia.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training_dpi
> +++ a.c
> @@ -619,7 +619,7 @@ static enum link_training_result
> dpia_training_eq_non_transparent(
>       uint32_t retries_eq = 0;
>       enum dc_status status;
>       enum dc_dp_training_pattern tr_pattern;
> -     uint32_t wait_time_microsec;
> +     uint32_t wait_time_microsec = 0;
>       enum dc_lane_count lane_count = lt_settings-
> >link_settings.lane_count;
>       union lane_align_status_updated dpcd_lane_status_updated = {0};
>       union lane_status dpcd_lane_status[LANE_COUNT_DP_MAX] = {0};
> --
> 2.34.1



More information about the amd-gfx mailing list