<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=iso-2022-jp">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
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:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"MS PGothic";
panose-1:2 11 6 0 7 2 5 8 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@MS PGothic";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:JA;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:JA;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:JA;}
p.msipheader4d0fcdd7, li.msipheader4d0fcdd7, div.msipheader4d0fcdd7
{mso-style-name:msipheader4d0fcdd7;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:JA;}
p.msipheader87abd423, li.msipheader87abd423, div.msipheader87abd423
{mso-style-name:msipheader87abd423;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:SimSun;
mso-fareast-language:JA;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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">
<div class="WordSection1">
<p class="msipheader87abd423" style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"MS PGothic",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal">Hello Tao,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">That is an interesting suggestion, I agree that there is a little bit of duplicate code with the same for loops being used in multiple functions.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">My only concern with implementing the loops in a macro is code readability.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’ll have to think about the trade off between the duplicate code and code readability more.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal">John Clements<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<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, January 3, 2020 10:53 AM<br>
<b>To:</b> Clements, John <John.Clements@amd.com>; amd-gfx@lists.freedesktop.org; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: resolved bug in UMC 6 error counter query<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="msipheader87abd423" style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:SimSun"><o:p> </o:p></span></p>
<p class="MsoNormal">I think we can implement it by only updating amdgpu_umc_for_each_channel macro, here is an example:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">#define amdgpu_umc_for_each_channel(func) \<o:p></o:p></p>
<p class="MsoNormal"> struct ras_err_data *err_data = \<o:p></o:p></p>
<p class="MsoNormal"> (struct ras_err_data *)ras_error_status; \<o:p></o:p></p>
<p class="MsoNormal"> uint32_t umc_inst, channel_inst, umc_reg_offset, channel_index; \<o:p></o:p></p>
<p class="MsoNormal"> for (umc_inst = 0; umc_inst < adev->umc.umc_inst_num; \<o:p></o:p></p>
<p class="MsoNormal"> umc_inst++) { \<o:p></o:p></p>
<p class="MsoNormal"> umc_reg_offset = adev->umc.inst_offs * umc_inst; \<o:p></o:p></p>
<p class="MsoNormal"> for (channel_inst = 0; \<o:p></o:p></p>
<p class="MsoNormal"> channel_inst < adev->umc.channel_inst_num; \<o:p></o:p></p>
<p class="MsoNormal"> channel_inst++) { \<o:p></o:p></p>
<p class="MsoNormal"> /* get channel index of interleaved memory */ \<o:p></o:p></p>
<p class="MsoNormal"> channel_index = adev->umc.channel_idx_tbl[\<o:p></o:p></p>
<p class="MsoNormal"> umc_inst * adev->umc.channel_inst_num + channel_inst]; \<o:p></o:p></p>
<p class="MsoNormal"> (func)(adev, err_data, umc_reg_offset, channel_index); \<o:p></o:p></p>
<p class="MsoNormal"> /* increase register offset for next channel */ \<o:p></o:p></p>
<p class="MsoNormal"> umc_reg_offset += adev->umc.channel_offs; \<o:p></o:p></p>
<p class="MsoNormal"> } \<o:p></o:p></p>
<p class="MsoNormal"> }<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">Tao<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> Clements, John <<a href="mailto:John.Clements@amd.com">John.Clements@amd.com</a>>
<br>
<b>Sent:</b> 2020<span lang="ZH-CN" style="font-family:SimSun;mso-fareast-language:ZH-CN">年</span>1<span lang="ZH-CN" style="font-family:SimSun;mso-fareast-language:ZH-CN">月</span>2<span lang="ZH-CN" style="font-family:SimSun;mso-fareast-language:ZH-CN">日</span>
18:31<br>
<b>To:</b> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>; Zhang, Hawking <<a href="mailto:Hawking.Zhang@amd.com">Hawking.Zhang@amd.com</a>>; Zhou1, Tao <<a href="mailto:Tao.Zhou1@amd.com">Tao.Zhou1@amd.com</a>><br>
<b>Subject:</b> [PATCH] drm/amdgpu: resolved bug in UMC 6 error counter query<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="msipheader4d0fcdd7" style="margin:0in;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Added patch to resolve following issue where error counter detection was not iterating over all UMC instances/channels.<o:p></o:p></p>
<p class="MsoNormal">Removed support for accessing UMC error counters via MMIO.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal">John Clements<o:p></o:p></p>
</div>
</div>
</body>
</html>