<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
yes, it is a coding error, I will correct it.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
thanks.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Kevin</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Lazar, Lijo <Lijo.Lazar@amd.com><br>
<b>Sent:</b> Wednesday, August 11, 2021 5:45 PM<br>
<b>To:</b> Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Feng, Kenneth <Kenneth.Feng@amd.com>; Min, Frank <Frank.Min@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> Re: [PATCH 4/5] drm/amd/pm: change return value in aldebaran_get_power_limit()</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText"><br>
<br>
On 8/11/2021 2:03 PM, Kevin Wang wrote:<br>
> 1. change return value to avoid smu driver probe fails when FEATURE_PPT is<br>
> not enabled.<br>
> 2. if FEATURE_PPT is not enabled, set power limit value to 0.<br>
> <br>
> Signed-off-by: Kevin Wang <kevin1.wang@amd.com><br>
> ---<br>
> .../gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 15 +++++++++++++--<br>
> 1 file changed, 13 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c<br>
> index fd04391364ac..e00ac43515bb 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c<br>
> @@ -1194,8 +1194,19 @@ static int aldebaran_get_power_limit(struct smu_context *smu,<br>
> uint32_t power_limit = 0;<br>
> int ret;<br>
> <br>
> - if (!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT))<br>
> - return -EINVAL;<br>
> + if (!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT)) {<br>
> + if (current_power_limit)<br>
> + *current_power_limit = 0;<br>
> + if (default_power_limit)<br>
> + *default_power_limit = 0;<br>
> + if (max_power_limit)<br>
> + *max_power_limit = 0;<br>
> +<br>
> + dev_err(smu->adev->dev,<br>
> + "the PPT feature is not enabled, set power limit to 0");<br>
> +<br>
<br>
Maybe downgrade to dev_warn as it is not an error from driver <br>
perspective, it only limits the information available.<br>
<br>
Thanks,<br>
Lijo<br>
<br>
> + return 0;<br>
> + }<br>
> <br>
> /* Valid power data is available only from primary die.<br>
> * For secondary die show the value as 0.<br>
> <br>
</div>
</span></font></div>
</div>
</body>
</html>