<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<p style="font-family:Arial;font-size:10pt;color:#317100;margin:15pt;" align="Left">
[AMD Public Use]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal">Reported-and-tested-by: Flora Cui <flora.cui@amd.com><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Deucher, Alexander <Alexander.Deucher@amd.com> <br>
<b>Sent:</b> Monday, June 8, 2020 11:02 PM<br>
<b>To:</b> Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Cui, Flora <Flora.Cui@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amd/powerplay: move maximum sustainable clock retrieving to .hw_init<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Acked-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com">alexander.deucher@amd.com</a>><o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>><br>
<b>Sent:</b> Monday, June 8, 2020 6:46 AM<br>
<b>To:</b> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a> <<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Cc:</b> Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>>; Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>>; Cui, Flora <<a href="mailto:Flora.Cui@amd.com">Flora.Cui@amd.com</a>><br>
<b>Subject:</b> [PATCH] drm/amd/powerplay: move maximum sustainable clock retrieving to .hw_init</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Since DAL settings come between .hw_init and .late_init of SMU. And<br>
DAL needs to know the maximum sustainable clocks.<br>
<br>
Change-Id: I0702b7332a0d7c0b29dfdf4999c18efb588b8862<br>
Signed-off-by: Evan Quan <<a href="mailto:evan.quan@amd.com">evan.quan@amd.com</a>><br>
Reported-by: Flora Cui <<a href="mailto:flora.cui@amd.com">flora.cui@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 19 +++++++++++++------<br>
1 file changed, 13 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
index 725ac90c0f36..6beae3b496be 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
@@ -819,12 +819,6 @@ static int smu_late_init(void *handle)<br>
return ret;<br>
}<br>
<br>
- ret = smu_init_max_sustainable_clocks(smu);<br>
- if (ret) {<br>
- dev_err(adev->dev, "Failed to init max sustainable clocks!\n");<br>
- return ret;<br>
- }<br>
-<br>
ret = smu_populate_umd_state_clk(smu);<br>
if (ret) {<br>
dev_err(adev->dev, "Failed to populate UMD state clocks!\n");<br>
@@ -1364,6 +1358,19 @@ static int smu_hw_init(void *handle)<br>
return ret;<br>
}<br>
<br>
+ /*<br>
+ * Move maximum sustainable clock retrieving here considering<br>
+ * 1. It is not needed on resume(from S3).<br>
+ * 2. DAL settings come between .hw_init and .late_init of SMU.<br>
+ * And DAL needs to know the maximum sustainable clocks. Thus<br>
+ * it cannot be put in .late_init().<br>
+ */<br>
+ ret = smu_init_max_sustainable_clocks(smu);<br>
+ if (ret) {<br>
+ dev_err(adev->dev, "Failed to init max sustainable clocks!\n");<br>
+ return ret;<br>
+ }<br>
+<br>
adev->pm.dpm_enabled = true;<br>
<br>
dev_info(adev->dev, "SMU is initialized successfully!\n");<br>
-- <br>
2.27.0<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>