<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;}
@font-face
{font-family:Aptos;}
/* 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.contentpasted0
{mso-style-name:contentpasted0;}
span.elementtoproof
{mso-style-name:elementtoproof;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@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">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal">The in_gpu_reset is set after reset error count and reset error status function call, so we can’t use amdgpu_in_reset(), please check ras->in_recovery flag.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Stanley<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> Zhou1, Tao <Tao.Zhou1@amd.com> <br>
<b>Sent:</b> Friday, October 13, 2023 5:06 PM<br>
<b>To:</b> Zhang, Hawking <Hawking.Zhang@amd.com>; amd-gfx@lists.freedesktop.org; Yang, Stanley <Stanley.Yang@amd.com>; Li, Candice <Candice.Li@amd.com>; Chai, Thomas <YiPeng.Chai@amd.com>; Wang, Yang(Kevin) <KevinYang.Wang@amd.com><br>
<b>Subject:</b> Re: [PATCH 4/5] drm/amdgpu: bypass RAS error reset in some conditions<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:5.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">[AMD Official Use Only - General]<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;font-family:"Aptos",sans-serif;color:black">How about this condition:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span class="contentpasted0"><span style="font-family:"Times New Roman",serif;color:black">if ((amdgpu_in_reset(adev) || amdgpu_ras_intr_triggered()) &&</span></span><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span class="contentpasted0"><span style="font-family:"Times New Roman",serif;color:black"> mca_funcs && mca_funcs->mca_set_debug_mode)</span></span><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">I use
</span><span class="contentpasted0"><span style="font-family:"Times New Roman",serif;color:black">amdgpu_in_reset</span></span><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"> to skip touching it in all gpu resets, not only for the
resets triggered by ras fatal error.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;color:black">Tao<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Aptos",sans-serif;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"> Zhang, Hawking <<a href="mailto:Hawking.Zhang@amd.com">Hawking.Zhang@amd.com</a>><br>
<b>Sent:</b> Thursday, October 12, 2023 9:14 PM<br>
<b>To:</b> Zhou1, Tao <<a href="mailto:Tao.Zhou1@amd.com">Tao.Zhou1@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>>; Yang, Stanley <<a href="mailto:Stanley.Yang@amd.com">Stanley.Yang@amd.com</a>>; Li, Candice
<<a href="mailto:Candice.Li@amd.com">Candice.Li@amd.com</a>>; Chai, Thomas <<a href="mailto:YiPeng.Chai@amd.com">YiPeng.Chai@amd.com</a>>; Wang, Yang(Kevin) <<a href="mailto:KevinYang.Wang@amd.com">KevinYang.Wang@amd.com</a>><br>
<b>Subject:</b> RE: [PATCH 4/5] drm/amdgpu: bypass RAS error reset in some conditions</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"><a name="BM_BEGIN"></a><span class="elementtoproof"><span style="font-family:"Times New Roman",serif">[AMD Official Use Only - General]</span></span><span style="font-family:"Times New Roman",serif"><br>
<br>
<span class="elementtoproof">- if (!amdgpu_ras_is_supported(adev, block))</span><br>
<span class="elementtoproof">+ /* skip ras error reset in gpu reset */</span><br>
<span class="elementtoproof">+ if (amdgpu_in_reset(adev) &&</span><br>
<span class="elementtoproof">+ mca_funcs && mca_funcs->mca_set_debug_mode)</span><br>
<span class="elementtoproof">+ return 0;</span><br>
<br>
<span class="elementtoproof">We should check RAS in_recovery flag in such case. Reset domain is locked in relative late phase, at least *after* error counter harvest. Please double check.</span><br>
<br>
<span class="elementtoproof">Regards,</span><br>
<span class="elementtoproof">Hawking</span><br>
<span class="elementtoproof">-----Original Message-----</span><br>
<span class="elementtoproof">From: Zhou1, Tao <<a href="mailto:Tao.Zhou1@amd.com">Tao.Zhou1@amd.com</a>></span><br>
<span class="elementtoproof">Sent: Thursday, October 12, 2023 17:01</span><br>
<span class="elementtoproof">To: <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>; Yang, Stanley <<a href="mailto:Stanley.Yang@amd.com">Stanley.Yang@amd.com</a>>; Zhang, Hawking <<a href="mailto:Hawking.Zhang@amd.com">Hawking.Zhang@amd.com</a>>;
Li, Candice <<a href="mailto:Candice.Li@amd.com">Candice.Li@amd.com</a>>; Chai, Thomas <<a href="mailto:YiPeng.Chai@amd.com">YiPeng.Chai@amd.com</a>>; Wang, Yang(Kevin) <<a href="mailto:KevinYang.Wang@amd.com">KevinYang.Wang@amd.com</a>></span><br>
<span class="elementtoproof">Cc: Zhou1, Tao <<a href="mailto:Tao.Zhou1@amd.com">Tao.Zhou1@amd.com</a>></span><br>
<span class="elementtoproof">Subject: [PATCH 4/5] drm/amdgpu: bypass RAS error reset in some conditions</span><br>
<br>
<span class="elementtoproof">PMFW is responsible for RAS error reset in some conditions, driver can skip the operation.</span><br>
<br>
<span class="elementtoproof">Signed-off-by: Tao Zhou <<a href="mailto:tao.zhou1@amd.com">tao.zhou1@amd.com</a>></span><br>
<span class="elementtoproof">---</span><br>
<span class="elementtoproof"> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 18 ++++++++++++++++--</span><br>
<span class="elementtoproof"> 1 file changed, 16 insertions(+), 2 deletions(-)</span><br>
<br>
<span class="elementtoproof">diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c</span><br>
<span class="elementtoproof">index 91ed4fd96ee1..6dddb0423411 100644</span><br>
<span class="elementtoproof">--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c</span><br>
<span class="elementtoproof">+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c</span><br>
<span class="elementtoproof">@@ -1105,11 +1105,18 @@ int amdgpu_ras_reset_error_count(struct amdgpu_device *adev,</span><br>
<span class="elementtoproof"> enum amdgpu_ras_block block)</span><br>
<span class="elementtoproof"> {</span><br>
<span class="elementtoproof"> struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev, block, 0);</span><br>
<span class="elementtoproof">+ const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;</span><br>
<br>
<span class="elementtoproof"> if (!block_obj || !block_obj->hw_ops)</span><br>
<span class="elementtoproof"> return 0;</span><br>
<br>
<span class="elementtoproof">- if (!amdgpu_ras_is_supported(adev, block))</span><br>
<span class="elementtoproof">+ /* skip ras error reset in gpu reset */</span><br>
<span class="elementtoproof">+ if (amdgpu_in_reset(adev) &&</span><br>
<span class="elementtoproof">+ mca_funcs && mca_funcs->mca_set_debug_mode)</span><br>
<span class="elementtoproof">+ return 0;</span><br>
<span class="elementtoproof">+</span><br>
<span class="elementtoproof">+ if (!amdgpu_ras_is_supported(adev, block) ||</span><br>
<span class="elementtoproof">+ !amdgpu_ras_get_mca_debug_mode(adev))</span><br>
<span class="elementtoproof"> return 0;</span><br>
<br>
<span class="elementtoproof"> if (block_obj->hw_ops->reset_ras_error_count)</span><br>
<span class="elementtoproof">@@ -1122,6 +1129,7 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,</span><br>
<span class="elementtoproof"> enum amdgpu_ras_block block)</span><br>
<span class="elementtoproof"> {</span><br>
<span class="elementtoproof"> struct amdgpu_ras_block_object *block_obj = amdgpu_ras_get_ras_block(adev, block, 0);</span><br>
<span class="elementtoproof">+ const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs;</span><br>
<br>
<span class="elementtoproof"> if (!block_obj || !block_obj->hw_ops) {</span><br>
<span class="elementtoproof"> dev_dbg_once(adev->dev, "%s doesn't config RAS function\n", @@ -1129,7 +1137,13 @@ int amdgpu_ras_reset_error_status(struct amdgpu_device *adev,</span><br>
<span class="elementtoproof"> return 0;</span><br>
<span class="elementtoproof"> }</span><br>
<br>
<span class="elementtoproof">- if (!amdgpu_ras_is_supported(adev, block))</span><br>
<span class="elementtoproof">+ /* skip ras error reset in gpu reset */</span><br>
<span class="elementtoproof">+ if (amdgpu_in_reset(adev) &&</span><br>
<span class="elementtoproof">+ mca_funcs && mca_funcs->mca_set_debug_mode)</span><br>
<span class="elementtoproof">+ return 0;</span><br>
<span class="elementtoproof">+</span><br>
<span class="elementtoproof">+ if (!amdgpu_ras_is_supported(adev, block) ||</span><br>
<span class="elementtoproof">+ !amdgpu_ras_get_mca_debug_mode(adev))</span><br>
<span class="elementtoproof"> return 0;</span><br>
<br>
<span class="elementtoproof"> if (block_obj->hw_ops->reset_ras_error_count)</span><br>
<span class="elementtoproof">--</span><br>
<span class="elementtoproof">2.35.1</span></span><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>