Skip to content

Commit 40baba5

Browse files
jntestevesalexdeucher
authored andcommitted
drm/amd/pm: Fix output of pp_od_clk_voltage
Printing the other clock types should not be conditioned on being able to print OD_SCLK. Some GPUs currently have limited capability of only printing a subset of these. Since this condition was introduced in v5.18-rc1, reading from `pp_od_clk_voltage` has been returning empty on the Asus ROG Strix G15 (2021). Fixes: 79c65f3 ("drm/amd/pm: do not expose power implementation details to amdgpu_pm.c") Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Jonatas Esteves <jntesteves@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 0d2dd02 commit 40baba5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -871,13 +871,11 @@ static ssize_t amdgpu_get_pp_od_clk_voltage(struct device *dev,
871871
}
872872
if (ret == -ENOENT) {
873873
size = amdgpu_dpm_print_clock_levels(adev, OD_SCLK, buf);
874-
if (size > 0) {
875-
size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size);
876-
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size);
877-
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size);
878-
size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size);
879-
size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size);
880-
}
874+
size += amdgpu_dpm_print_clock_levels(adev, OD_MCLK, buf + size);
875+
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDC_CURVE, buf + size);
876+
size += amdgpu_dpm_print_clock_levels(adev, OD_VDDGFX_OFFSET, buf + size);
877+
size += amdgpu_dpm_print_clock_levels(adev, OD_RANGE, buf + size);
878+
size += amdgpu_dpm_print_clock_levels(adev, OD_CCLK, buf + size);
881879
}
882880

883881
if (size == 0)

0 commit comments

Comments
 (0)