<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>I think no need to check function type.<br>
<br>
Best Regards<br>
Rex
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Deucher, Alexander <Alexander.Deucher@amd.com><br>
<b>Sent:</b> Tuesday, April 18, 2017 9:33:58 PM<br>
<b>To:</b> Huang, Trigger; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Huang, Trigger<br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: Fix module unload hang by KIQ on Vega10</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">> -----Original Message-----<br>
> From: amd-gfx [<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">mailto:amd-gfx-bounces@lists.freedesktop.org</a>] On Behalf<br>
> Of Trigger Huang<br>
> Sent: Monday, April 17, 2017 10:14 PM<br>
> To: amd-gfx@lists.freedesktop.org<br>
> Cc: Huang, Trigger<br>
> Subject: [PATCH] drm/amdgpu: Fix module unload hang by KIQ on Vega10<br>
> <br>
> Apply commit 4e683cb2644f ("drm/amdgpu: Fix module unload hang by<br>
> KIQ IRQ set")to vega10<br>
> <br>
> Signed-off-by: Trigger Huang <trigger.huang@amd.com><br>
<br>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
<br>
> ---<br>
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++------<br>
>  1 file changed, 4 insertions(+), 6 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> index f6b2329..b7b2ed8 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c<br>
> @@ -631,7 +631,6 @@ static int gfx_v9_0_kiq_init_ring(struct<br>
> amdgpu_device *adev,<br>
>                ring->pipe = 1;<br>
>        }<br>
> <br>
> -     irq->data = ring;<br>
>        ring->queue = 0;<br>
>        ring->eop_gpu_addr = kiq->eop_gpu_addr;<br>
>        sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring-<br>
> >queue);<br>
> @@ -647,7 +646,6 @@ static void gfx_v9_0_kiq_free_ring(struct<br>
> amdgpu_ring *ring,<br>
>  {<br>
>        amdgpu_wb_free(ring->adev, ring->adev->virt.reg_val_offs);<br>
>        amdgpu_ring_fini(ring);<br>
> -     irq->data = NULL;<br>
>  }<br>
> <br>
>  /* create MQD for each compute queue */<br>
> @@ -3367,9 +3365,9 @@ static int gfx_v9_0_kiq_set_interrupt_state(struct<br>
> amdgpu_device *adev,<br>
>                                            enum amdgpu_interrupt_state<br>
> state)<br>
>  {<br>
>        uint32_t tmp, target;<br>
> -     struct amdgpu_ring *ring = (struct amdgpu_ring *)src->data;<br>
> +     struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);<br>
> <br>
> -     BUG_ON(!ring || (ring->funcs->type !=<br>
> AMDGPU_RING_TYPE_KIQ));<br>
> +     BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);<br>
> <br>
>        if (ring->me == 1)<br>
>                target = SOC15_REG_OFFSET(GC, 0,<br>
> mmCP_ME1_PIPE0_INT_CNTL);<br>
> @@ -3413,9 +3411,9 @@ static int gfx_v9_0_kiq_irq(struct amdgpu_device<br>
> *adev,<br>
>                            struct amdgpu_iv_entry *entry)<br>
>  {<br>
>        u8 me_id, pipe_id, queue_id;<br>
> -     struct amdgpu_ring *ring = (struct amdgpu_ring *)source->data;<br>
> +     struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);<br>
> <br>
> -     BUG_ON(!ring || (ring->funcs->type !=<br>
> AMDGPU_RING_TYPE_KIQ));<br>
> +     BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);<br>
> <br>
>        me_id = (entry->ring_id & 0x0c) >> 2;<br>
>        pipe_id = (entry->ring_id & 0x03) >> 0;<br>
> --<br>
> 2.7.4<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><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><br>
</div>
</span></font>
</body>
</html>