<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>
<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">8:38<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 v3 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/25/2022 11:40 AM, Stanley.Yang wrote:<br>
> Changed from V1:<br>
> remove unnecessary same row physical address calculation<br>
> <br>
> Changed from V2:<br>
> move record_ce_addr_supported to umc_ecc_info struct<br>
> <br>
> Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 5 ++<br>
> drivers/gpu/drm/amd/amdgpu/umc_v6_7.c | 50 ++++++++++++++++++-<br>
> .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 +<br>
> 3 files changed, 54 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h<br>
> index 28e603243b67..bf5a95104ec1 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h<br>
> @@ -333,6 +333,11 @@ struct ecc_info_per_ch {<br>
> <br>
> struct umc_ecc_info {<br>
> struct ecc_info_per_ch ecc[MAX_UMC_CHANNEL_NUM];<br>
> +<br>
> + /* Determine smu ecctable whether support<br>
> + * record correctable error address<br>
> + */<br>
> + int record_ce_addr_supported;<br>
> };<br>
> <br>
> struct amdgpu_ras {<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..bf7524f16b66 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 (ras->umc_ecc.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>
<br>
UMC address to PA conversion is common regardless of UE/CE error <br>
addresses. You may want to pack it in a small function.<br>
<br>
Regardless,<br>
Acked-by: Lijo Lazar <lijo.lazar@amd.com><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">Stanley: These lines are indeed redundant. I'll make a patch to simplify it.<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">Reagards,<br>
Stanley<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><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,31 @@ 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>
> + dev_info(adev->dev, "Error Address(PA): 0x%llx\n", soc_pa);<br>
> + }<br>
> }<br>
> }<br>
> <br>
> @@ -395,7 +440,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..c7e0fec614ea 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>
> @@ -1883,6 +1883,7 @@ static ssize_t aldebaran_get_ecc_info(struct smu_context *smu,<br>
> ecc_info_per_channel->mca_ceumc_addr =<br>
> ecc_table->EccInfo_V2[i].mca_ceumc_addr;<br>
> }<br>
> + eccinfo->record_ce_addr_supported =1;<br>
> }<br>
> <br>
> return ret;<br>
> <o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>