Re: [PATCH AUTOSEL 4.19 246/252] drm/amdgpu/smu10: fix smu10_get_clock_by_type_with_voltage
From: Alex Deucher
Date: Fri Feb 14 2020 - 11:49:51 EST
On Fri, Feb 14, 2020 at 11:17 AM Sasha Levin <sashal@xxxxxxxxxx> wrote:
>
> From: Alex Deucher <alexander.deucher@xxxxxxx>
>
> [ Upstream commit 1064ad4aeef94f51ca230ac639a9e996fb7867a0 ]
>
> Cull out 0 clocks to avoid a warning in DC.
>
> Bug: https://gitlab.freedesktop.org/drm/amd/issues/963
Same comment as for 5.5. All of the upstream patches that reference
that bug need to be applied or they all need to be dropped.
Alex
> Reviewed-by: Evan Quan <evan.quan@xxxxxxx>
> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
> index 3fa6e8123b8eb..48e31711bc68f 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
> @@ -1048,9 +1048,11 @@ static int smu10_get_clock_by_type_with_voltage(struct pp_hwmgr *hwmgr,
>
> clocks->num_levels = 0;
> for (i = 0; i < pclk_vol_table->count; i++) {
> - clocks->data[i].clocks_in_khz = pclk_vol_table->entries[i].clk * 10;
> - clocks->data[i].voltage_in_mv = pclk_vol_table->entries[i].vol;
> - clocks->num_levels++;
> + if (pclk_vol_table->entries[i].clk) {
> + clocks->data[clocks->num_levels].clocks_in_khz = pclk_vol_table->entries[i].clk * 10;
> + clocks->data[clocks->num_levels].voltage_in_mv = pclk_vol_table->entries[i].vol;
> + clocks->num_levels++;
> + }
> }
>
> return 0;
> --
> 2.20.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx