<html 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=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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:Aptos;
        panose-1:2 11 0 4 2 2 2 2 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:0cm;
        font-size:10.0pt;
        font-family:"Aptos",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-CN" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">                         if ((amdgpu_bad_page_threshold == -1) ||<br>
-                           (amdgpu_bad_page_threshold == -2)) {<br>
+                               (amdgpu_bad_page_threshold == -2)) {<br>
<br>
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">hmm…. Is it fixing code alignment?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Regards,<br>
Hawking<o:p></o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Xie, Patrick <Gangliang.Xie@amd.com><br>
<b>Date: </b>Friday, June 13, 2025 at 11:07<br>
<b>To: </b>amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc: </b>Zhang, Hawking <Hawking.Zhang@amd.com>, Zhou1, Tao <Tao.Zhou1@amd.com>, Xie, Patrick <Gangliang.Xie@amd.com><br>
<b>Subject: </b>[PATCH] drm/amdgpu: refine usage of amdgpu_bad_page_threshold<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">when amdgpu_bad_page_threshold == -1 or -2, driver will issue a warning<br>
message when threshold is reached and continue runtime services.<br>
<br>
Signed-off-by: ganglxie <ganglxie@amd.com><br>
---<br>
 .../gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c    | 21 +++++++++----------<br>
 1 file changed, 10 insertions(+), 11 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c<br>
index 2ddedf476542..a9246c53bde9 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c<br>
@@ -763,18 +763,17 @@ amdgpu_ras_eeprom_update_header(struct amdgpu_ras_eeprom_control *control)<br>
                 dev_warn(adev->dev,<br>
                         "Saved bad pages %d reaches threshold value %d\n",<br>
                         control->ras_num_bad_pages, ras->bad_page_cnt_threshold);<br>
-               control->tbl_hdr.header = RAS_TABLE_HDR_BAD;<br>
-               if (control->tbl_hdr.version >= RAS_TABLE_VER_V2_1) {<br>
-                       control->tbl_rai.rma_status = GPU_RETIRED__ECC_REACH_THRESHOLD;<br>
-                       control->tbl_rai.health_percent = 0;<br>
-               }<br>
-<br>
                 if ((amdgpu_bad_page_threshold != -1) &&<br>
-                   (amdgpu_bad_page_threshold != -2))<br>
+                   (amdgpu_bad_page_threshold != -2)) {<br>
+                       control->tbl_hdr.header = RAS_TABLE_HDR_BAD;<br>
+                       if (control->tbl_hdr.version >= RAS_TABLE_VER_V2_1) {<br>
+                               control->tbl_rai.rma_status = GPU_RETIRED__ECC_REACH_THRESHOLD;<br>
+                               control->tbl_rai.health_percent = 0;<br>
+                       }<br>
                         ras->is_rma = true;<br>
-<br>
-               /* ignore the -ENOTSUPP return value */<br>
-               amdgpu_dpm_send_rma_reason(adev);<br>
+                       /* ignore the -ENOTSUPP return value */<br>
+                       amdgpu_dpm_send_rma_reason(adev);<br>
+               }<br>
         }<br>
 <br>
         if (control->tbl_hdr.version >= RAS_TABLE_VER_V2_1)<br>
@@ -1509,7 +1508,7 @@ int amdgpu_ras_eeprom_check(struct amdgpu_ras_eeprom_control *control)<br>
                                 "RAS records:%d exceed threshold:%d\n",<br>
                                 control->ras_num_bad_pages, ras->bad_page_cnt_threshold);<br>
                         if ((amdgpu_bad_page_threshold == -1) ||<br>
-                           (amdgpu_bad_page_threshold == -2)) {<br>
+                               (amdgpu_bad_page_threshold == -2)) {<br>
                                 res = 0;<br>
                                 dev_warn(adev->dev,<br>
                                          "Please consult AMD Service Action Guide (SAG) for appropriate service procedures\n");<br>
-- <br>
2.34.1<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>