<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Do you know what the sampling period is on vega?  We should try and be consistent.  How about making this selectable via hwmon:</p>
<p style="margin-top:0;margin-bottom:0"></p>
<pre>power[1-*]_average_interval  Power use averaging interval.  A poll
                                notification is sent to this file if the
                                hardware changes the averaging interval.
                                Unit: milliseconds
                                RW

power[1-*]_average_interval_max Maximum power use averaging interval
                                Unit: milliseconds
                                RO

power[1-*]_average_interval_min Minimum power use averaging interval
                                Unit: milliseconds
                                RO</pre>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Then the user can select the interval they want.<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Alex<br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Eric Huang <JinHuiEric.Huang@amd.com><br>
<b>Sent:</b> Thursday, March 29, 2018 3:21:52 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Huang, JinHuiEric<br>
<b>Subject:</b> [PATCH] drm/amd/powerply: fix power reading on Fiji</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Power value is wrong reported by customer. It is a regression by<br>
<br>
commit a7c7bc4c0c47eaac77b8fa92f0672032df7f4254<br>
Author: Rex Zhu <Rex.Zhu@amd.com><br>
Date:   Mon Mar 27 15:32:59 2017 +0800<br>
<br>
    drm/amd/powerplay: reduce sample period time<br>
<br>
    for power readings.<br>
<br>
    Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com><br>
<br>
The theoretical sampling period is from 50ms to 4sec, original 2sec<br>
is long but correct, and 20ms is too short. change it to more<br>
reasonable 200ms.<br>
<br>
Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com><br>
---<br>
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++-<br>
 1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
index a03b7fe..7631d80 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
@@ -3377,7 +3377,8 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr,<br>
                         "Failed to start pm status log!",<br>
                         return -1);<br>
 <br>
-       msleep_interruptible(20);<br>
+       /* Sampling period from 50ms to 4sec */<br>
+       msleep_interruptible(200);<br>
 <br>
         PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,<br>
                         PPSMC_MSG_PmStatusLogSample),<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>