<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=gb2312">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@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:"\@等线";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:宋体;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:DengXian;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="ZH-CN" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian"><o:p> </o:p></span></p>
<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="color:black">发件人</span></b><b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">:</span></b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"> Lazar,
Lijo <Lijo.Lazar@amd.com><br>
</span><b><span style="color:black">日期</span></b><b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">:</span></b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">
</span><span style="color:black">星期三</span><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">, 2022</span><span style="color:black">年</span><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">5</span><span style="color:black">月</span><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">25</span><span style="color:black">日</span><span style="font-family:"Calibri",sans-serif;color:black">
</span><span style="color:black">上午</span><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">12:03<br>
</span><b><span style="color:black">收件人</span></b><b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">:</span></b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"> Yang, Stanley <Stanley.Yang@amd.com>, amd-gfx@lists.freedesktop.org
<amd-gfx@lists.freedesktop.org>, Zhang, Hawking <Hawking.Zhang@amd.com>, Zhou1, Tao <Tao.Zhou1@amd.com>, Quan, Evan <Evan.Quan@amd.com><br>
</span><b><span style="color:black">主题</span></b><b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black">:</span></b><span lang="EN-US" style="font-family:"Calibri",sans-serif;color:black"> Re: [PATCH Review v2 2/2] drm/amdgpu: print umc
correctable error address<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><br>
<br>
On 5/24/2022 8:00 PM, Stanley.Yang wrote:<br>
> Changed from V1:<br>
> remove unnecessary same row physical address calculation<br>
> <br>
> Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 ++<br>
> drivers/gpu/drm/amd/amdgpu/umc_v6_7.c | 52 ++++++++++++++++++-<br>
> .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 +<br>
> 3 files changed, 56 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> index 3f23f9ad3249..985b8cddb5a1 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> @@ -1108,6 +1108,11 @@ struct amdgpu_device {<br>
> <br>
> bool scpm_enabled;<br>
> uint32_t scpm_status;<br>
> +<br>
> + /* Determine smu ecctable whether support<br>
> + * record correctable error address<br>
> + */<br>
> + int record_ce_addr_supported;<br>
<br>
Why not keep this in umc_ecc_info passed back from FW?<br>
<br>
Thanks,<br>
Lijo<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:DengXian">Stanley: Good point, this can keep the overall logic of the RAS ecctableinfo, thanks Lijo.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><br>
<br>
> };<br>
> <br>
> static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c b/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c<br>
> index 606892dbea1c..91bdc5e048c2 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c<br>
> @@ -119,6 +119,24 @@ static void umc_v6_7_ecc_info_query_correctable_error_count(struct amdgpu_device<br>
> *error_count += 1;<br>
> <br>
> umc_v6_7_query_error_status_helper(adev, mc_umc_status, umc_reg_offset);<br>
> +<br>
> + if (adev->record_ce_addr_supported) {<br>
> + uint64_t err_addr, soc_pa;<br>
> + uint32_t channel_index =<br>
> + adev->umc.channel_idx_tbl[umc_inst * adev->umc.channel_inst_num + ch_inst];<br>
> +<br>
> + err_addr = ras->umc_ecc.ecc[eccinfo_table_idx].mca_ceumc_addr;<br>
> + err_addr = REG_GET_FIELD(err_addr, MCA_UMC_UMC0_MCUMC_ADDRT0, ErrorAddr);<br>
> + /* translate umc channel address to soc pa, 3 parts are included */<br>
> + soc_pa = ADDR_OF_8KB_BLOCK(err_addr) |<br>
> + ADDR_OF_256B_BLOCK(channel_index) |<br>
> + OFFSET_IN_256B_BLOCK(err_addr);<br>
> +<br>
> + /* The umc channel bits are not original values, they are hashed */<br>
> + SET_CHANNEL_HASH(channel_index, soc_pa);<br>
> +<br>
> + dev_info(adev->dev, "Error Address(PA): 0x%llx\n", soc_pa);<br>
> + }<br>
> }<br>
> }<br>
> <br>
> @@ -251,7 +269,9 @@ static void umc_v6_7_ecc_info_query_ras_error_address(struct amdgpu_device *adev<br>
> <br>
> static void umc_v6_7_query_correctable_error_count(struct amdgpu_device *adev,<br>
> uint32_t umc_reg_offset,<br>
> - unsigned long *error_count)<br>
> + unsigned long *error_count,<br>
> + uint32_t ch_inst,<br>
> + uint32_t umc_inst)<br>
> {<br>
> uint32_t ecc_err_cnt_sel, ecc_err_cnt_sel_addr;<br>
> uint32_t ecc_err_cnt, ecc_err_cnt_addr;<br>
> @@ -295,6 +315,33 @@ static void umc_v6_7_query_correctable_error_count(struct amdgpu_device *adev,<br>
> *error_count += 1;<br>
> <br>
> umc_v6_7_query_error_status_helper(adev, mc_umc_status, umc_reg_offset);<br>
> +<br>
> + {<br>
> + uint64_t err_addr, soc_pa;<br>
> + uint32_t mc_umc_addrt0;<br>
> + uint32_t channel_index;<br>
> +<br>
> + mc_umc_addrt0 =<br>
> + SOC15_REG_OFFSET(UMC, 0, regMCA_UMC_UMC0_MCUMC_ADDRT0);<br>
> +<br>
> + channel_index =<br>
> + adev->umc.channel_idx_tbl[umc_inst * adev->umc.channel_inst_num + ch_inst];<br>
> +<br>
> + err_addr = RREG64_PCIE((mc_umc_addrt0 + umc_reg_offset) * 4);<br>
> + err_addr = REG_GET_FIELD(err_addr, MCA_UMC_UMC0_MCUMC_ADDRT0, ErrorAddr);<br>
> +<br>
> + /* translate umc channel address to soc pa, 3 parts are included */<br>
> + soc_pa = ADDR_OF_8KB_BLOCK(err_addr) |<br>
> + ADDR_OF_256B_BLOCK(channel_index) |<br>
> + OFFSET_IN_256B_BLOCK(err_addr);<br>
> +<br>
> + /* The umc channel bits are not original values, they are hashed */<br>
> + SET_CHANNEL_HASH(channel_index, soc_pa);<br>
> +<br>
> + /* clear [C4 C3 C2] in soc physical address */<br>
> + soc_pa &= ~(0x7ULL << UMC_V6_7_PA_C2_BIT);<br>
> + dev_info(adev->dev, "Error Address(PA): 0x%llx\n", soc_pa);<br>
> + }<br>
> }<br>
> }<br>
> <br>
> @@ -395,7 +442,8 @@ static void umc_v6_7_query_ras_error_count(struct amdgpu_device *adev,<br>
> ch_inst);<br>
> umc_v6_7_query_correctable_error_count(adev,<br>
> umc_reg_offset,<br>
> - &(err_data->ce_count));<br>
> + &(err_data->ce_count),<br>
> + ch_inst, umc_inst);<br>
> umc_v6_7_querry_uncorrectable_error_count(adev,<br>
> umc_reg_offset,<br>
> &(err_data->ue_count));<br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c<br>
> index 9cdfeea58085..e41a5b6fc64b 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c<br>
> @@ -1882,6 +1882,7 @@ static ssize_t aldebaran_get_ecc_info(struct smu_context *smu,<br>
> ecc_table->EccInfo_V2[i].mca_umc_addr;<br>
> ecc_info_per_channel->mca_ceumc_addr =<br>
> ecc_table->EccInfo_V2[i].mca_ceumc_addr;<br>
> + smu->adev->record_ce_addr_supported =1;<br>
> }<br>
> }<br>
> <br>
> <o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>