Re: [PATCH] drm/amdgpu/dc: Avoid PSR AUX WARN on unhealthy eDP link

[email protected]
Newsgroups org.freedesktop.lists.dri-devel
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The function `dpcd_set_link_settings()` returns an uninitialized `status` variable on its success path.
--

--- Patch [1]: [PATCH] drm/amdgpu/dc: Avoid PSR AUX WARN on unhealthy eDP link ---
commit ea92b689001bf0ca86b430f7c8b3fa5b47810b12
Author: Kean Ren <[email protected]>

drm/amdgpu/dc: Avoid PSR AUX WARN on unhealthy eDP link

This commit fixes PSR AUX WARNs on unhealthy eDP links by returning early
from dpcd_set_link_settings() on the first DPCD write failure, and by
short-circuiting edp_setup_psr() when the link is inactive.

> diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
> index 04eedec8a230c..501d2556e06c5 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c
> @@ -1097,6 +1097,7 @@ enum dc_status dpcd_set_link_settings(
>  {
>  	uint8_t rate;
>  	enum dc_status status;
> +	enum dc_status result;

[Severity: High]
Since the assignments in this function were changed from status to result,
is status left uninitialized?

If all DPCD writes succeed, the function completes by returning status at the
end of the function:

dpcd_set_link_settings() {
    ...
    return status;
}

Does this cause dpcd_set_link_settings() to return random stack memory on the
success path, potentially causing callers to interpret a success as an error
and fail the display initialization?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.