<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.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="#0563C1" vlink="#954F72" 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">+ while (i < 11)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Please use macro to replace the magic number. No one want to play with the code which need some sort of guess to figure out hack setting or experimental ones.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<br>
Hawking<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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org>
<b>On Behalf Of </b>Zhao, Jiange<br>
<b>Sent:</b> Monday, December 7, 2020 16:15<br>
<b>To:</b> Zhao, Jiange <Jiange.Zhao@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhang, Andy <Andy.Zhang@amd.com>; Chen, Horace <Horace.Chen@amd.com>; Min, Frank <Frank.Min@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:5.0pt"><span style="font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p style="margin:5.0pt"><span style="font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]<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">ping!<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"> Zhao, Jiange <<a href="mailto:jianzh@amd.com">jianzh@amd.com</a>><br>
<b>Sent:</b> Wednesday, November 25, 2020 10:10 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> Min, Frank <<a href="mailto:Frank.Min@amd.com">Frank.Min@amd.com</a>>; Chen, Horace <<a href="mailto:Horace.Chen@amd.com">Horace.Chen@amd.com</a>>; Zhang, Andy <<a href="mailto:Andy.Zhang@amd.com">Andy.Zhang@amd.com</a>>; Zhao, Jiange <<a href="mailto:Jiange.Zhao@amd.com">Jiange.Zhao@amd.com</a>><br>
<b>Subject:</b> [PATCH] drm/amdgpu/SRIOV: Extend VF reset request wait period</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">From: Jiange Zhao <<a href="mailto:Jiange.Zhao@amd.com">Jiange.Zhao@amd.com</a>><br>
<br>
In Virtualization case, when one VF is sending too many<br>
FLR requests, hypervisor would stop responding to this<br>
VF's request for a long period of time. This is called<br>
event guard. During this period of cooling time, guest<br>
driver should wait instead of doing other things. After<br>
this period of time, guest driver would resume reset<br>
process and return to normal.<br>
<br>
Currently, guest driver would wait 12 seconds and return fail<br>
if it doesn't get response from host.<br>
<br>
Solution: extend this waiting time in guest driver and poll<br>
response periodically.<br>
<br>
Signed-off-by: Jiange Zhao <<a href="mailto:Jiange.Zhao@amd.com">Jiange.Zhao@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 11 ++++++++++-<br>
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h | 2 +-<br>
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 11 ++++++++++-<br>
3 files changed, 21 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c<br>
index f5ce9a9f4cf5..d8d8c623bb74 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c<br>
@@ -187,7 +187,16 @@ static int xgpu_ai_send_access_requests(struct amdgpu_device *adev,<br>
<br>
static int xgpu_ai_request_reset(struct amdgpu_device *adev)<br>
{<br>
- return xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_RESET_ACCESS);<br>
+ int ret, i = 0;<br>
+<br>
+ while (i < 11) {<br>
+ ret = xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_RESET_ACCESS);<br>
+ if (!ret)<br>
+ break;<br>
+ i++;<br>
+ }<br>
+<br>
+ return ret;<br>
}<br>
<br>
static int xgpu_ai_request_full_gpu_access(struct amdgpu_device *adev,<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h<br>
index 83b453f5d717..20ee2142f9ed 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h<br>
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h<br>
@@ -25,7 +25,7 @@<br>
#define __MXGPU_AI_H__<br>
<br>
#define AI_MAILBOX_POLL_ACK_TIMEDOUT 500<br>
-#define AI_MAILBOX_POLL_MSG_TIMEDOUT 12000<br>
+#define AI_MAILBOX_POLL_MSG_TIMEDOUT 6000<br>
#define AI_MAILBOX_POLL_FLR_TIMEDOUT 5000<br>
<br>
enum idh_request {<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c<br>
index 666ed99cc14b..0147dfe21a39 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c<br>
@@ -200,7 +200,16 @@ static int xgpu_nv_send_access_requests(struct amdgpu_device *adev,<br>
<br>
static int xgpu_nv_request_reset(struct amdgpu_device *adev)<br>
{<br>
- return xgpu_nv_send_access_requests(adev, IDH_REQ_GPU_RESET_ACCESS);<br>
+ int ret, i = 0;<br>
+<br>
+ while (i < 11) {<br>
+ ret = xgpu_nv_send_access_requests(adev, IDH_REQ_GPU_RESET_ACCESS);<br>
+ if (!ret)<br>
+ break;<br>
+ i++;<br>
+ }<br>
+<br>
+ return ret;<br>
}<br>
<br>
static int xgpu_nv_request_full_gpu_access(struct amdgpu_device *adev,<br>
-- <br>
2.25.1<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>