<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:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.msipheaderc10f11a2, li.msipheaderc10f11a2, div.msipheaderc10f11a2
{mso-style-name:msipheaderc10f11a2;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.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" style="word-wrap:break-word">
<div class="WordSection1">
<p class="msipheaderc10f11a2" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:green">[Public]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for the review. I’m only going to merge 2-4 initially though.<o:p></o:p></p>
<p class="MsoNormal">The reporter on 1 has some questionable results, and I have a follow up patch for them to try.<o:p></o:p></p>
<p class="MsoNormal">If that combined with 1 looks good I’ll bring that patch for review.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<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> Thursday, January 27, 2022 08:50<br>
<b>To:</b> Limonciello, Mario <Mario.Limonciello@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Liang, Prike <Prike.Liang@amd.com><br>
<b>Subject:</b> Re: [PATCH v6 4/4] drm/amd: Only run s3 or s0ix if system is configured properly<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:green">[Public]<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">Series is:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Reviewed-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"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Mario Limonciello <<a href="mailto:mario.limonciello@amd.com">mario.limonciello@amd.com</a>><br>
<b>Sent:</b> Wednesday, January 26, 2022 5:58 PM<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> Liang, Prike <<a href="mailto:Prike.Liang@amd.com">Prike.Liang@amd.com</a>>; Limonciello, Mario <<a href="mailto:Mario.Limonciello@amd.com">Mario.Limonciello@amd.com</a>><br>
<b>Subject:</b> [PATCH v6 4/4] drm/amd: Only run s3 or s0ix if system is configured properly</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">This will cause misconfigured systems to not run the GPU suspend<br>
routines.<br>
<br>
* In APUs that are properly configured system will go into s2idle.<br>
* In APUs that are intended to be S3 but user selects<br>
s2idle the GPU will stay fully powered for the suspend.<br>
* In APUs that are intended to be s2idle and system misconfigured<br>
the GPU will stay fully powered for the suspend.<br>
* In systems that are intended to be s2idle, but AMD dGPU is also<br>
present, the dGPU will go through S3<br>
<br>
Signed-off-by: Mario Limonciello <<a href="mailto:mario.limonciello@amd.com">mario.limonciello@amd.com</a>><br>
---<br>
v5->v6:<br>
* Move code into prepare vfunc and use DPM_FLAG_SMART_SUSPEND to skip<br>
suspend code in incorrectly configured systems.<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++++<br>
1 file changed, 8 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 922accdd4246..3e581f35f19d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -2289,6 +2289,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)<br>
static int amdgpu_pmops_prepare(struct device *dev)<br>
{<br>
struct drm_device *drm_dev = dev_get_drvdata(dev);<br>
+ struct amdgpu_device *adev = drm_to_adev(drm_dev);<br>
<br>
/* Return a positive number here so<br>
* DPM_FLAG_SMART_SUSPEND works properly<br>
@@ -2296,6 +2297,13 @@ static int amdgpu_pmops_prepare(struct device *dev)<br>
if (amdgpu_device_supports_boco(drm_dev))<br>
return pm_runtime_suspended(dev);<br>
<br>
+ /* if we will not support s3 or s2i for the device<br>
+ * then skip suspend<br>
+ */<br>
+ if (!amdgpu_acpi_is_s0ix_active(adev) &&<br>
+ !amdgpu_acpi_is_s3_active(adev))<br>
+ return 1;<br>
+<br>
return 0;<br>
}<br>
<br>
-- <br>
2.25.1<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>