[PATCH] drm/amd/powerplay: fix pcie sysfs interface when set wrong value
Huang Rui
ray.huang at amd.com
Mon Mar 4 06:32:13 UTC 2019
On Mon, Mar 04, 2019 at 11:47:49AM +0800, likun Gao wrote:
> From: Likun Gao <Likun.Gao at amd.com>
>
> The operation of mutex_unlock smu->mutex should be done when forced level is larger than NUM_LINK_LEVELS in the function of force_clk_levels.
>
> Reported-by: Julia Lawall <julia.lawall at lip6.fr>
> Signed-off-by: Likun Gao <Likun.Gao at amd.com>
Reviewed-by: Huang Rui <ray.huang at amd.com>
> ---
> drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
> index f7188a7..4b1fc45 100644
> --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
> @@ -1206,8 +1206,10 @@ static int vega20_force_clk_levels(struct smu_context *smu,
>
> case PP_PCIE:
> if (soft_min_level >= NUM_LINK_LEVELS ||
> - soft_max_level >= NUM_LINK_LEVELS)
> - return -EINVAL;
> + soft_max_level >= NUM_LINK_LEVELS) {
> + ret = -EINVAL;
> + break;
> + }
>
> ret = smu_send_smc_msg_with_param(smu,
> SMU_MSG_SetMinLinkDpmByIndex, soft_min_level);
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list