<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Yuan, Xiaojie <Xiaojie.Yuan@amd.com><br>
<b>Sent:</b> Wednesday, August 21, 2019 9:52 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> alexdeucher@gmail.com <alexdeucher@gmail.com>; Xiao, Jack <Jack.Xiao@amd.com>; Yuan, Xiaojie <Xiaojie.Yuan@amd.com>; Zhang, Hawking <Hawking.Zhang@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu/sdma5: fix number of sdma5 trap irq types for navi1x</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">v2: set num_types based on num_instances<br>
<br>
navi1x has 2 sdma engines but commit<br>
"e7b58d03b678 drm/amdgpu: reorganize sdma v4 code to support more instances"<br>
changes the max number of sdma irq types (AMDGPU_SDMA_IRQ_LAST) from 2 to 8<br>
which causes amdgpu_irq_gpu_reset_resume_helper() to recover irq of sdma<br>
engines with following logic:<br>
<br>
(enable irq for sdma0) * 1 time<br>
(enable irq for sdma1) * 1 time<br>
(disable irq for sdma1) * 6 times<br>
<br>
as a result, after gpu reset, interrupt for sdma1 is lost.<br>
<br>
Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 3 ++-<br>
 1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c<br>
index 41932d8b88c3..89174e778d2f 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c<br>
@@ -1625,7 +1625,8 @@ static const struct amdgpu_irq_src_funcs sdma_v5_0_illegal_inst_irq_funcs = {<br>
 <br>
 static void sdma_v5_0_set_irq_funcs(struct amdgpu_device *adev)<br>
 {<br>
-       adev->sdma.trap_irq.num_types = AMDGPU_SDMA_IRQ_LAST;<br>
+       adev->sdma.trap_irq.num_types = AMDGPU_SDMA_IRQ_INSTANCE0 +<br>
+                                       adev->sdma.num_instances;<br>
         adev->sdma.trap_irq.funcs = &sdma_v5_0_trap_irq_funcs;<br>
         adev->sdma.illegal_inst_irq.funcs = &sdma_v5_0_illegal_inst_irq_funcs;<br>
 }<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>