<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
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:11.0pt;
font-family:"Calibri",sans-serif;}
.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">
<p style="font-family:Arial;font-size:10pt;color:#317100;margin:15pt;" align="Left">
[AMD Public Use]<br>
</p>
<br>
<div>
<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"><o:p> </o:p></p>
<p class="MsoNormal">Hi, YinTao<o:p></o:p></p>
<p class="MsoNormal">The write to CSIB register through RLCG requires RLCG firmware to support it. This currently only implemented by nv12 . So you need to find a way to block it for other GFX 10 asic like NV14 , nv21 if you want to revert the code.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On existing code , amdgpu_mm_wreg_mmio_rlc seems do what is expected (fall back to MMIO if RLCG support not there) from the name , so although it originally designed for debugfs case access, we should check why it failed on your case
. <o:p></o:p></p>
<p class="MsoNormal">In my previous fix , I try to only initialize the rlcg_write function pointer for nv12. The function amdgpu_mm_wreg_mmio_rlc will depends on SRIOV and rlcg_write function to go through rlcg way . This will exclude the bare-metal mode
. Do you see the issue on bare metal mode on nv12 ? If that’s the case we might can consider to remove the SRIOV check inside function amdgpu_mm_wreg_mmio_rlc .
<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">Shaoyun.liu<o:p></o:p></p>
<p class="MsoNormal"><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> Deucher, Alexander <Alexander.Deucher@amd.com> <br>
<b>Sent:</b> Tuesday, May 12, 2020 10:26 AM<br>
<b>To:</b> Tao, Yintian <Yintian.Tao@amd.com>; Liu, Monk <Monk.Liu@amd.com>; Liu, Shaoyun <Shaoyun.Liu@amd.com><br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org; Tao, Yintian <Yintian.Tao@amd.com><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: turn back rlcg write for gfx_v10<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#317100">[AMD Public Use]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Acked-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com">alexander.deucher@amd.com</a>><o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Yintian Tao <<a href="mailto:yttao@amd.com">yttao@amd.com</a>><br>
<b>Sent:</b> Tuesday, May 12, 2020 6:17 AM<br>
<b>To:</b> Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>>; Liu, Monk <<a href="mailto:Monk.Liu@amd.com">Monk.Liu@amd.com</a>>; Liu, Shaoyun <<a href="mailto:Shaoyun.Liu@amd.com">Shaoyun.Liu@amd.com</a>><br>
<b>Cc:</b> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a> <<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>>; Tao, Yintian <<a href="mailto:Yintian.Tao@amd.com">Yintian.Tao@amd.com</a>><br>
<b>Subject:</b> [PATCH] drm/amdgpu: turn back rlcg write for gfx_v10</span> <o:p>
</o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">There is no need to use amdgpu_mm_wreg_mmio_rlc()<br>
during initialization time because this interface<br>
is only designed for debugfs case to access the<br>
registers which are only permitted by RLCG during<br>
run-time. Therefore, turn back rlcg write for gfx_v10.<br>
If we not turn back it, it will raise amdgpu load failure.<br>
[ 54.904333] amdgpu: SMU driver if version not matched<br>
[ 54.904393] amdgpu: SMU is initialized successfully!<br>
[ 54.905971] [drm] kiq ring mec 2 pipe 1 q 0<br>
[ 55.115416] amdgpu 0000:00:06.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring gfx_0.0.0 test failed (-110)<br>
[ 55.118877] [drm:amdgpu_device_init [amdgpu]] *ERROR* hw_init of IP block <gfx_v10_0> failed -110<br>
[ 55.126587] amdgpu 0000:00:06.0: amdgpu_device_ip_init failed<br>
[ 55.133466] amdgpu 0000:00:06.0: Fatal error during GPU init<br>
<br>
Signed-off-by: Yintian Tao <<a href="mailto:yttao@amd.com">yttao@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 14 ++++++--------<br>
1 file changed, 6 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
index 449408cfd018..bd5dd4f64311 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c<br>
@@ -4577,13 +4577,11 @@ static int gfx_v10_0_init_csb(struct amdgpu_device *adev)<br>
adev->gfx.rlc.funcs->get_csb_buffer(adev, adev->gfx.rlc.cs_ptr);<br>
<br>
/* csib */<br>
- /* amdgpu_mm_wreg_mmio_rlc will fall back to mmio if doesn't support rlcg_write */<br>
- amdgpu_mm_wreg_mmio_rlc(adev, SOC15_REG_OFFSET(GC, 0, mmRLC_CSIB_ADDR_HI),<br>
- adev->gfx.rlc.clear_state_gpu_addr >> 32, 0);<br>
- amdgpu_mm_wreg_mmio_rlc(adev, SOC15_REG_OFFSET(GC, 0, mmRLC_CSIB_ADDR_LO),<br>
- adev->gfx.rlc.clear_state_gpu_addr & 0xfffffffc, 0);<br>
- amdgpu_mm_wreg_mmio_rlc(adev, SOC15_REG_OFFSET(GC, 0, mmRLC_CSIB_LENGTH),<br>
- adev->gfx.rlc.clear_state_size, 0);<br>
+ WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_ADDR_HI,<br>
+ adev->gfx.rlc.clear_state_gpu_addr >> 32);<br>
+ WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_ADDR_LO,<br>
+ adev->gfx.rlc.clear_state_gpu_addr & 0xfffffffc);<br>
+ WREG32_SOC15_RLC(GC, 0, mmRLC_CSIB_LENGTH, adev->gfx.rlc.clear_state_size);<br>
<br>
return 0;<br>
}<br>
@@ -5192,7 +5190,7 @@ static int gfx_v10_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable)<br>
tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, ME_HALT, enable ? 0 : 1);<br>
tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, PFP_HALT, enable ? 0 : 1);<br>
tmp = REG_SET_FIELD(tmp, CP_ME_CNTL, CE_HALT, enable ? 0 : 1);<br>
- amdgpu_mm_wreg_mmio_rlc(adev, SOC15_REG_OFFSET(GC, 0, mmCP_ME_CNTL), tmp, 0);<br>
+ WREG32_SOC15_RLC(GC, 0, mmCP_ME_CNTL, tmp);<br>
<br>
for (i = 0; i < adev->usec_timeout; i++) {<br>
if (RREG32_SOC15(GC, 0, mmCP_STAT) == 0)<br>
-- <br>
2.17.1<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>