]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function
authorTom Rix <trix@redhat.com>
Mon, 24 Jan 2022 20:18:12 +0000 (12:18 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:29 +0000 (11:57 +0200)
commitffd57f84addfbc7b460d60c7c740e7c59302dcc9
treec6c48105a68c5a8b8679e3e2066992ca116c7507
parent1a81cd41b226949dbc0807ae2d99a11d167eb021
drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 430e6a0212b2a0eb1de5e9d47a016fa79edf3978 ]

clang static analysis reports this represenative problem
amdgpu_smu.c:144:18: warning: The left operand of '*' is a garbage value
        return clk_freq * 100;
               ~~~~~~~~ ^

If there is no get_dpm_ultimate_freq function,
smu_get_dpm_freq_range returns success without setting the
output min,max parameters.  So return an -ENOTSUPP error.

Fixes: e5ef784b1e17 ("drm/amd/powerplay: revise calling chain on retrieving frequency range")
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit b175bc58641032cfdb89f92afd76939be2ae22b4)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c