<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial" size="2"><span style="font-size:10pt;">
<div style="padding-right:5pt;padding-left:5pt;"><font color="blue">[AMD Official Use Only - General]<br>

</font></div>
<div style="margin-top:5pt;"><font face="Times New Roman" size="3"><span style="font-size:12pt;"><br>

</span></font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">_____________________________________________<br>

<b>From:</b> Zhang, Hawking <Hawking.Zhang@amd.com> <br>

<b>Sent:</b> Wednesday, January 3, 2024 5:36 PM<br>

<b>To:</b> Wang, Yang(Kevin) <KevinYang.Wang@amd.com>; amd-gfx@lists.freedesktop.org<br>

<b>Cc:</b> Zhou1, Tao <Tao.Zhou1@amd.com>; Chai, Thomas <YiPeng.Chai@amd.com><br>

<b>Subject:</b> RE: [PATCH 02/14] drm/amdgpu: add ACA kernel hardware error log support</span></font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"> </span></font></div>
<div style="padding-right:5pt;padding-left:5pt;"><font face="Arial" color="blue">[AMD Official Use Only - General]<br>

</font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"><br>

</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       dev_info(adev->dev, "[Hardware error] Accelerator Check Architecture events logged\n");</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       /* plus 1 for output format, e.g: ACA[08/08]: xxxx */</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       for (i = 0; i < ARRAY_SIZE(aca_regs); i++)</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+               dev_info(adev->dev, "[Hardware error] ACA[%02d/%02d].%s=0x%016llx\n",</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+                        idx + 1, total, aca_regs[i].name, bank->regs[aca_regs[i].reg_idx]);</span></font></div>
<div><font face="Times New Roman" size="2" color="#2F5496"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">We should keep the ACA log format simple since there are tools like crash dumper that grab these logs.</span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">How about formatting log as below</span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">dev_info(adev->dev, "[Hardware error] Accelerator Check Architecture (ACA) events logged\n");</span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">dev_info(adev$B"*(Bdev, "[Hardware error] ACA.%s=0x%016llx\n");</span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">In general, if the idx doesn't convey useful information, then just replace it with ACA.Reg.</span></font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">[Kevin]:</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Agree, will update it in next version.</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Best Regards,</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Kevin</span></font></div>
<div><font face="Times New Roman" size="2" color="#2F5496"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">Thoughts?</span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">Regards,</span></font></div>
<div><font face="Calibri" size="2" color="#2F5496"><span style="font-size:11pt;">Hawking</span></font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">-----Original Message-----</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">From: Wang, Yang(Kevin) <<a href="mailto:KevinYang.Wang@amd.com"><font color="#0563C1"><u>KevinYang.Wang@amd.com</u></font></a>> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Sent: Wednesday, January 3, 2024 16:02</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">To: <a href="mailto:amd-gfx@lists.freedesktop.org"><font color="#0563C1"><u>amd-gfx@lists.freedesktop.org</u></font></a></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Cc: Zhang, Hawking <<a href="mailto:Hawking.Zhang@amd.com"><font color="#0563C1"><u>Hawking.Zhang@amd.com</u></font></a>>; Zhou1, Tao <<a href="mailto:Tao.Zhou1@amd.com"><font color="#0563C1"><u>Tao.Zhou1@amd.com</u></font></a>>;
Chai, Thomas <<a href="mailto:YiPeng.Chai@amd.com"><font color="#0563C1"><u>YiPeng.Chai@amd.com</u></font></a>>; Wang, Yang(Kevin) <<a href="mailto:KevinYang.Wang@amd.com"><font color="#0563C1"><u>KevinYang.Wang@amd.com</u></font></a>></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Subject: [PATCH 02/14] drm/amdgpu: add ACA kernel hardware error log support</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">add ACA kernel hardware error log support.</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">Signed-off-by: Yang Wang <<a href="mailto:kevinyang.wang@amd.com"><font color="#0563C1"><u>kevinyang.wang@amd.com</u></font></a>></span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">---</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 29 +++++++++++++++++++++++++</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> 1 file changed, 29 insertions(+)</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">index 6a6f167b5380..cadeda64eded 100644</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">@@ -100,6 +100,33 @@ static int aca_smu_get_valid_aca_count(struct amdgpu_device *adev, enum aca_erro</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">         return smu_funcs->get_valid_aca_count(adev, type, count);  }</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+static struct aca_regs_dump {</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       const char *name;</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       int reg_idx;</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+} aca_regs[] = {</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"CONTROL",             ACA_REG_IDX_CTL},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"STATUS",              ACA_REG_IDX_STATUS},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"ADDR",                ACA_REG_IDX_ADDR},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"MISC",                ACA_REG_IDX_MISC0},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"CONFIG",              ACA_REG_IDX_CONFG},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"IPID",                ACA_REG_IDX_IPID},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"SYND",                ACA_REG_IDX_SYND},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"DESTAT",              ACA_REG_IDX_DESTAT},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"DEADDR",              ACA_REG_IDX_DEADDR},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       {"CONTROL_MASK",        ACA_REG_IDX_CTL_MASK},</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+};</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+static void aca_smu_bank_dump(struct amdgpu_device *adev, int idx, int </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+total, struct aca_bank *bank) {</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       int i;</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       dev_info(adev->dev, "[Hardware error] Accelerator Check Architecture events logged\n");</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       /* plus 1 for output format, e.g: ACA[08/08]: xxxx */</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+       for (i = 0; i < ARRAY_SIZE(aca_regs); i++)</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+               dev_info(adev->dev, "[Hardware error] ACA[%02d/%02d].%s=0x%016llx\n",</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+                        idx + 1, total, aca_regs[i].name, bank->regs[aca_regs[i].reg_idx]); </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+}</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> static int aca_smu_get_valid_aca_banks(struct amdgpu_device *adev, enum aca_error_type type,</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">                                        int start, int count,</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">                                        struct aca_banks *banks)</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">@@ -137,6 +164,8 @@ static int aca_smu_get_valid_aca_banks(struct amdgpu_device *adev, enum aca_erro</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">                 if (ret)</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">                         return ret;</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+               aca_smu_bank_dump(adev, i, count, &bank);</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">+</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">                 ret = aca_banks_add_bank(banks, &bank);</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">                 if (ret)</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">                         return ret;</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">--</span></font></div>
<div><font face="Calibri" size="2"><span style="font-size:11pt;">2.34.1</span></font></div>
<div><font face="Times New Roman" size="2"><span style="font-size:11pt;"> </span></font></div>
</span></font>
</body>
</html>