<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;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
p.msipheader251902e5, li.msipheader251902e5, div.msipheader251902e5
        {mso-style-name:msipheader251902e5;
        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="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="msipheader251902e5" style="margin:0in"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks Alex. Yes, you are right. BACO is used as a power saving feature for runpm. I missed that.<o:p></o:p></p>
<p class="MsoNormal">I wrongly treated BACO as a reset method only which cannot be used with mode1 reset at the same time.<o:p></o:p></p>
<p class="MsoNormal">Please ignore this patch.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">BR<o:p></o:p></p>
<p class="MsoNormal">Evan<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> Saturday, March 20, 2021 12:46 AM<br>
<b>To:</b> Lazar, Lijo <Lijo.Lazar@amd.com>; Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen<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">Yeah, the reset method is independent of whether we can use BACO for runtime PM.  We can use BACO for power saving and use mode1 for reset.  Is there some issue I'm missing?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Alex<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><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 Lazar, Lijo <<a href="mailto:Lijo.Lazar@amd.com">Lijo.Lazar@amd.com</a>><br>
<b>Sent:</b> Friday, March 19, 2021 7:27 AM<br>
<b>To:</b> Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>>;
<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> Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>><br>
<b>Subject:</b> RE: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">[AMD Public Use]<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> On Behalf Of Evan Quan<br>
Sent: Friday, March 19, 2021 2:42 PM<br>
To: <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
Cc: Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>><br>
Subject: [PATCH 2/2] drm/amdgpu: disable runpm if other reset method not runpm capable is chosen<br>
<br>
Otherwise, the runpm will be always enabled on a BACO capable target even the reset method was forced as like mode1.<br>
<br>
Change-Id: If6bf55c533e91470c9c83383788466161608f68d<br>
Signed-off-by: Evan Quan <<a href="mailto:evan.quan@amd.com">evan.quan@amd.com</a>><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu.h     | 1 +<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +-  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++<br>
 drivers/gpu/drm/amd/amdgpu/cik.c        | 2 +-<br>
 drivers/gpu/drm/amd/amdgpu/nv.c         | 2 +-<br>
 drivers/gpu/drm/amd/amdgpu/si.c         | 2 +-<br>
 drivers/gpu/drm/amd/amdgpu/soc15.c      | 2 +-<br>
 drivers/gpu/drm/amd/amdgpu/vi.c         | 2 +-<br>
 8 files changed, 9 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
index 963ecfd84347..be12dd2550b8 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
@@ -589,6 +589,7 @@ struct amdgpu_allowed_register_entry {  };<br>
 <br>
 enum amd_reset_method {<br>
+       AMD_RESET_METHOD_AUTO = -1,<br>
         AMD_RESET_METHOD_LEGACY = 0,<br>
         AMD_RESET_METHOD_MODE0,<br>
         AMD_RESET_METHOD_MODE1,<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 6a06234dbcad..78e5445b28b5 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -168,7 +168,7 @@ int amdgpu_noretry = -1;  int amdgpu_force_asic_type = -1;  int amdgpu_tmz = -1; /* auto */  uint amdgpu_freesync_vid_mode; -int amdgpu_reset_method = -1; /* auto */<br>
+int amdgpu_reset_method = AMD_RESET_METHOD_AUTO; /* auto */<br>
 int amdgpu_num_kcq = -1;<br>
 <br>
 static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
index 8844f650b17f..49068ad698a6 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
@@ -168,6 +168,8 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)<br>
                 adev->runpm = true;<br>
                 dev_info(adev->dev, "Using BOCO for runtime pm\n");<br>
         } else if (amdgpu_device_supports_baco(dev) &&<br>
+                  (amdgpu_reset_method == AMD_RESET_METHOD_AUTO ||<br>
+                   amdgpu_reset_method == AMD_RESET_METHOD_BACO) &&<br>
<br>
< > Why to link runpm suspend method with reset method?<br>
<br>
Thanks,<br>
Lijo<br>
                    (amdgpu_runtime_pm != 0)) {<br>
                 switch (adev->asic_type) {<br>
                 case CHIP_VEGA20:<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c<br>
index c0fcc41ee574..e671871f4d28 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/cik.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c<br>
@@ -1395,7 +1395,7 @@ cik_asic_reset_method(struct amdgpu_device *adev)<br>
             amdgpu_reset_method == AMD_RESET_METHOD_BACO)<br>
                 return amdgpu_reset_method;<br>
 <br>
-       if (amdgpu_reset_method != -1)<br>
+       if (amdgpu_reset_method != AMD_RESET_METHOD_AUTO)<br>
                 dev_warn(adev->dev, "Specified reset:%d isn't supported, using AUTO instead.\n",<br>
                                   amdgpu_reset_method);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c index 2670ae00c2e5..1e751d415f15 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/nv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c<br>
@@ -529,7 +529,7 @@ nv_asic_reset_method(struct amdgpu_device *adev)<br>
             amdgpu_reset_method == AMD_RESET_METHOD_PCI)<br>
                 return amdgpu_reset_method;<br>
 <br>
-       if (amdgpu_reset_method != -1)<br>
+       if (amdgpu_reset_method != AMD_RESET_METHOD_AUTO)<br>
                 dev_warn(adev->dev, "Specified reset method:%d isn't supported, using AUTO instead.\n",<br>
                                   amdgpu_reset_method);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c index 7cbc2bb03bc6..b9db761a7cc5 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/si.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/si.c<br>
@@ -1420,7 +1420,7 @@ si_asic_reset_method(struct amdgpu_device *adev)<br>
         if (amdgpu_reset_method == AMD_RESET_METHOD_PCI)<br>
                 return amdgpu_reset_method;<br>
         else if (amdgpu_reset_method != AMD_RESET_METHOD_LEGACY &&<br>
-                amdgpu_reset_method != -1)<br>
+                amdgpu_reset_method != AMD_RESET_METHOD_AUTO)<br>
                 dev_warn(adev->dev, "Specified reset method:%d isn't supported, using AUTO instead.\n",<br>
                          amdgpu_reset_method);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
index c354a11e2fd9..ad11f2e1f4db 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c<br>
@@ -689,7 +689,7 @@ soc15_asic_reset_method(struct amdgpu_device *adev)<br>
                 return amdgpu_reset_method;<br>
         }<br>
 <br>
-       if (amdgpu_reset_method != -1)<br>
+       if (amdgpu_reset_method != AMD_RESET_METHOD_AUTO)<br>
                 dev_warn(adev->dev, "Specified reset method:%d isn't supported, using AUTO instead.\n",<br>
                                   amdgpu_reset_method);<br>
 <br>
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index ea338de5818a..6b380a25e22e 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/vi.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c<br>
@@ -895,7 +895,7 @@ vi_asic_reset_method(struct amdgpu_device *adev)<br>
             amdgpu_reset_method == AMD_RESET_METHOD_BACO)<br>
                 return amdgpu_reset_method;<br>
 <br>
-       if (amdgpu_reset_method != -1)<br>
+       if (amdgpu_reset_method != AMD_RESET_METHOD_AUTO)<br>
                 dev_warn(adev->dev, "Specified reset method:%d isn't supported, using AUTO instead.\n",<br>
                                   amdgpu_reset_method);<br>
 <br>
--<br>
2.29.0<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%3D&amp;reserved=0</a><br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%3D&amp;reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Calexander.deucher%40amd.com%7C5cacb7cb280c4055647a08d8eac9edbc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517500293380275%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=93jzFipkAGazXCqwfxbKUkvTDUHmuSZT6cNAcymg%2BRQ%3D&amp;reserved=0</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>