<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:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
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;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.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="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">If the flag ACPI_FADT_LOW_POWER_S0 not set or AMDPMC driver not build, then that seems will mess up the suspend entry and unable to enter either S3 nor S2idle properly. In this S2idle configuration issue case, how about add some message
 to notify end user how to configure S2idle correctly?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Prike<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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org>
<b>On Behalf Of </b>Limonciello, Mario<br>
<b>Sent:</b> Tuesday, January 18, 2022 1:26 AM<br>
<b>To:</b> Lazar, Lijo <Lijo.Lazar@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Bjoren Dasse <bjoern.daase@gmail.com><br>
<b>Subject:</b> RE: [PATCH v2] drm/amd: Warn users about potential s0ix problems<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<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">Yes, that’s part of why I want to make sure there are explicit warnings to users about using this flow.<o:p></o:p></p>
<p class="MsoNormal">When not enabled in ACPI then also the LPS0 device is not exported and AMD_PMC won’t load or be used.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think from amdgpu perspective it should behave relatively similar to an aborted suspend.<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> Lazar, Lijo <<a href="mailto:Lijo.Lazar@amd.com">Lijo.Lazar@amd.com</a>>
<br>
<b>Sent:</b> Monday, January 17, 2022 11:20<br>
<b>To:</b> Limonciello, Mario <<a href="mailto:Mario.Limonciello@amd.com">Mario.Limonciello@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Cc:</b> Bjoren Dasse <<a href="mailto:bjoern.daase@gmail.com">bjoern.daase@gmail.com</a>><br>
<b>Subject:</b> Re: [PATCH v2] drm/amd: Warn users about potential s0ix problems<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#212121">Any problem with PMFW sequence in the way Linux handles s2idle when it's not enabled in ACPI?<o:p></o:p></span></p>
</div>
<div id="ms-outlook-mobile-signature">
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Thanks,<br>
Lijo<o:p></o:p></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="1" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Limonciello, Mario <</span><a href="mailto:Mario.Limonciello@amd.com">Mario.Limonciello@amd.com</a><span style="color:black">><br>
<b>Sent:</b> Monday, January 17, 2022 10:45:44 PM<br>
<b>To:</b> </span><a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><span style="color:black"> <</span><a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><span style="color:black">>; Lazar, Lijo <</span><a href="mailto:Lijo.Lazar@amd.com">Lijo.Lazar@amd.com</a><span style="color:black">><br>
<b>Cc:</b> Bjoren Dasse <</span><a href="mailto:bjoern.daase@gmail.com">bjoern.daase@gmail.com</a><span style="color:black">><br>
<b>Subject:</b> RE: [PATCH v2] drm/amd: Warn users about potential s0ix problems</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">[Public]<br>
<br>
This has been sitting a week or so.<br>
Bump on review for this patch.<br>
<br>
> -----Original Message-----<br>
> From: Limonciello, Mario <<a href="mailto:Mario.Limonciello@amd.com">Mario.Limonciello@amd.com</a>><br>
> Sent: Tuesday, January 11, 2022 14:00<br>
> To: <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> Cc: Limonciello, Mario <<a href="mailto:Mario.Limonciello@amd.com">Mario.Limonciello@amd.com</a>>; Bjoren Dasse<br>
> <<a href="mailto:bjoern.daase@gmail.com">bjoern.daase@gmail.com</a>><br>
> Subject: [PATCH v2] drm/amd: Warn users about potential s0ix problems<br>
> <br>
> On some OEM setups users can configure the BIOS for S3 or S2idle.<br>
> When configured to S3 users can still choose 's2idle' in the kernel by<br>
> using `/sys/power/mem_sleep`.  Before commit 6dc8265f9803<br>
> ("drm/amdgpu:<br>
> always reset the asic in suspend (v2)"), the GPU would crash.  Now when<br>
> configured this way, the system should resume but will use more power.<br>
> <br>
> As such, adjust the `amdpu_acpi_is_s0ix function` to warn users about<br>
> potential power consumption issues during their first attempt at<br>
> suspending.<br>
> <br>
> Reported-by: Bjoren Dasse <<a href="mailto:bjoern.daase@gmail.com">bjoern.daase@gmail.com</a>><br>
> Link: <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1824&data=04%7C01%7CPrike.Liang%40amd.com%7C925d02acbde94f61cb2b08d9d9de74bc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637780371747154944%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=fO8dU9u204YesBNjoI99%2BAkngggcEgkQhet2mnkCRls%3D&reserved=0">
https://gitlab.freedesktop.org/drm/amd/-/issues/1824</a><br>
> Signed-off-by: Mario Limonciello <<a href="mailto:mario.limonciello@amd.com">mario.limonciello@amd.com</a>><br>
> ---<br>
> v1->v2:<br>
>  * Only show messages in s2idle cases<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 16 ++++++++++------<br>
>  1 file changed, 10 insertions(+), 6 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c<br>
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c<br>
> index 4811b0faafd9..1295de6d6c30 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c<br>
> @@ -1040,11 +1040,15 @@ void amdgpu_acpi_detect(void)<br>
>   */<br>
>  bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)<br>
>  {<br>
> -#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)<br>
> -     if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {<br>
> -             if (adev->flags & AMD_IS_APU)<br>
> -                     return pm_suspend_target_state ==<br>
> PM_SUSPEND_TO_IDLE;<br>
> -     }<br>
> +     if (!(adev->flags & AMD_IS_APU) ||<br>
> +         pm_suspend_target_state != PM_SUSPEND_TO_IDLE)<br>
> +             return false;<br>
> +     if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))<br>
> +             dev_warn_once(adev->dev,<br>
> +                           "BIOS is not configured for suspend-to-idle, power<br>
> consumption will be higher\n");<br>
> +#if !IS_ENABLED(CONFIG_AMD_PMC)<br>
> +     dev_warn_once(adev->dev,<br>
> +                   "amd-pmc is not enabled in the kernel, power<br>
> consumption will be higher\n");<br>
>  #endif<br>
> -     return false;<br>
> +     return true;<br>
>  }<br>
> --<br>
> 2.25.1<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>