[PATCH 4/5] drm/amd/pm: change return value in aldebaran_get_power_limit()

Wang, Kevin(Yang) Kevin1.Wang at amd.com
Wed Aug 11 14:29:12 UTC 2021


[AMD Official Use Only]

yes, it is a coding error, I will correct it.
thanks.

Best Regards,
Kevin
________________________________
From: Lazar, Lijo <Lijo.Lazar at amd.com>
Sent: Wednesday, August 11, 2021 5:45 PM
To: Wang, Kevin(Yang) <Kevin1.Wang at amd.com>; amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Feng, Kenneth <Kenneth.Feng at amd.com>; Min, Frank <Frank.Min at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: Re: [PATCH 4/5] drm/amd/pm: change return value in aldebaran_get_power_limit()



On 8/11/2021 2:03 PM, Kevin Wang wrote:
> 1. change return value to avoid smu driver probe fails when FEATURE_PPT is
> not enabled.
> 2. if FEATURE_PPT is not enabled, set power limit value to 0.
>
> Signed-off-by: Kevin Wang <kevin1.wang at amd.com>
> ---
>   .../gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c    | 15 +++++++++++++--
>   1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> index fd04391364ac..e00ac43515bb 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
> @@ -1194,8 +1194,19 @@ static int aldebaran_get_power_limit(struct smu_context *smu,
>        uint32_t power_limit = 0;
>        int ret;
>
> -     if (!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT))
> -             return -EINVAL;
> +     if (!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT)) {
> +             if (current_power_limit)
> +                     *current_power_limit = 0;
> +             if (default_power_limit)
> +                     *default_power_limit = 0;
> +             if (max_power_limit)
> +                     *max_power_limit = 0;
> +
> +             dev_err(smu->adev->dev,
> +                     "the PPT feature is not enabled, set power limit to 0");
> +

Maybe downgrade to dev_warn as it is not an error from driver
perspective, it only limits the information available.

Thanks,
Lijo

> +             return 0;
> +     }
>
>        /* Valid power data is available only from primary die.
>         * For secondary die show the value as 0.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210811/6c400790/attachment-0001.htm>


More information about the amd-gfx mailing list