<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:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</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> Du, Xiaojian <Xiaojian.Du@amd.com><br>
<b>Sent:</b> Wednesday, January 20, 2021 11:48 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Huang, Ray <Ray.Huang@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Du, Xiaojian <Xiaojian.Du@amd.com>; Du, Xiaojian <Xiaojian.Du@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/pm: make the error log more clear for fine grain tuning function</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">From: Xiaojian Du <xiaojian.du@amd.com><br>
<br>
From: Xiaojian Du <Xiaojian.Du@amd.com><br>
<br>
This patch is to make the error log more clear for fine grian tuning<br>
function, it covers Raven/Raven2/Picasso/Renoir/Vangogh.<br>
The fine grain tuning function uses the sysfs file -- pp_od_clk_voltage,<br>
but only when another sysfs file -- power_dpm_force_performance_level is<br>
switched to "manual" mode, it is allowd to access "pp_od_clk_voltage".<br>
<br>
Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com><br>
---<br>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 2 +-<br>
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c | 3 ++-<br>
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c | 3 ++-<br>
3 files changed, 5 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c<br>
index 88322781e447..ed05a30d1139 100644<br>
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c<br>
@@ -1487,7 +1487,7 @@ static int smu10_set_fine_grain_clk_vol(struct pp_hwmgr *hwmgr,<br>
}<br>
<br>
if (!smu10_data->fine_grain_enabled) {<br>
- pr_err("Fine grain not started\n");<br>
+ pr_err("pp_od_clk_voltage is not accessible if power_dpm_force_perfomance_level is not in manual mode!\n");</div>
<div class="PlainText">[kevin]:</div>
<div class="PlainText">for above codes, the old one looks better for me, i prefer to keep current design.</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">Best Regards,</div>
<div class="PlainText">Kevin<br>
return -EINVAL;<br>
}<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c<br>
index 6d3c556dbe6b..a847fa66797e 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c<br>
@@ -1452,7 +1452,8 @@ static int vangogh_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TAB<br>
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);<br>
<br>
if (!(smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL)) {<br>
- dev_warn(smu->adev->dev, "Fine grain is not enabled!\n");<br>
+ dev_warn(smu->adev->dev,<br>
+ "pp_od_clk_voltage is not accessible if power_dpm_force_perfomance_level is not in manual mode!\n");<br>
return -EINVAL;<br>
}<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c<br>
index ab15570305f7..4ce8fb1d5ce9 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c<br>
@@ -350,7 +350,8 @@ static int renoir_od_edit_dpm_table(struct smu_context *smu,<br>
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);<br>
<br>
if (!(smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL)) {<br>
- dev_warn(smu->adev->dev, "Fine grain is not enabled!\n");<br>
+ dev_warn(smu->adev->dev,<br>
+ "pp_od_clk_voltage is not accessible if power_dpm_force_perfomance_level is not in manual mode!\n");<br>
return -EINVAL;</div>
<div class="PlainText"><span style="font-family: "segoe ui", "segoe ui web (west european)", "segoe ui", -apple-system, blinkmacsystemfont, roboto, "helvetica neue", sans-serif; font-size: 11pt; color: rgb(50, 49, 48); background-color: rgba(0, 0, 0, 0);">[Kevin]:</span></div>
<div class="PlainText"></div>
<span style="color: rgb(50, 49, 48); font-family: "segoe ui", "segoe ui web (west european)", "segoe ui", -apple-system, blinkmacsystemfont, roboto, "helvetica neue", sans-serif; font-size: 11pt; text-align: justify; background-color: rgba(0, 0, 0, 0); display: inline !important;">Just
tell the User what's going on, not why.</span></span></font></div>
<div class="BodyFragment">
<div style="text-align: justify;"><font face="segoe ui, segoe ui web (west european), segoe ui, -apple-system, blinkmacsystemfont, roboto, helvetica neue, sans-serif"><span style="font-size: 14.6667px;">and we'd better make a function to check manual mode ,
the</span><span style="font-size: 11pt; font-family: "segoe ui", "segoe ui web (west european)", "segoe ui", -apple-system, blinkmacsystemfont, roboto, "helvetica neue", sans-serif; color: rgb(50, 49, 48); background-color: rgba(0, 0, 0, 0);">n
</span><span style="font-size: 14.6667px;"><span style="color: rgb(50, 49, 48); font-family: "segoe ui", "segoe ui web (west european)", "segoe ui", -apple-system, blinkmacsystemfont, roboto, "helvetica neue", sans-serif; font-size: 11pt; background-color: rgba(0, 0, 0, 0); display: inline !important;">embed</span></span><span style="font-size: 11pt; font-family: "segoe ui", "segoe ui web (west european)", "segoe ui", -apple-system, blinkmacsystemfont, roboto, "helvetica neue", sans-serif; color: rgb(50, 49, 48); background-color: rgba(0, 0, 0, 0);">
it t</span><span style="font-size: 14.6667px;">o every sysfs node in amdgpu_pm.c</span></font></div>
<div style="text-align: justify;"><span style="font-size: 14.6667px;">using a unify interface to return result to user.</span></div>
<font size="2"><span style="font-size:11pt">
<div class="PlainText"><br>
</div>
<div class="PlainText">Best Regards,</div>
<div class="PlainText">Kevin<br>
}<br>
<br>
-- <br>
2.17.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>