Skip to contentSkip to conversation

drm/amdgpu: Fix module unload hang by KIQ on Vega10

PATCH In review Trigger Huang 4 participants 4 messages Apr 18, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix module unload hang by KIQ on Vega10

Apply commit 4e683cb2644f ("drm/amdgpu: Fix module unload hang by KIQ IRQ set")to vega10

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +4 -6
index f6b2329..b7b2ed8 100644
@@ -631,7 +631,6 @@ static int gfx_v9_0_kiq_init_ring(struct amdgpu_device *adev,
 		ring->pipe = 1;
 	}
 
-	irq->data = ring;
 	ring->queue = 0;
 	ring->eop_gpu_addr = kiq->eop_gpu_addr;
 	sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring->queue);
@@ -647,7 +646,6 @@ static void gfx_v9_0_kiq_free_ring(struct amdgpu_ring *ring,
 {
 	amdgpu_wb_free(ring->adev, ring->adev->virt.reg_val_offs);
 	amdgpu_ring_fini(ring);
-	irq->data = NULL;
 }
 
 /* create MQD for each compute queue */
@@ -3367,9 +3365,9 @@ static int gfx_v9_0_kiq_set_interrupt_state(struct amdgpu_device *adev,
 					    enum amdgpu_interrupt_state state)
 {
 	uint32_t tmp, target;
-	struct amdgpu_ring *ring = (struct amdgpu_ring *)src->data;
+	struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-	BUG_ON(!ring || (ring->funcs->type != AMDGPU_RING_TYPE_KIQ));
+	BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
 
 	if (ring->me == 1)
 		target = SOC15_REG_OFFSET(GC, 0, mmCP_ME1_PIPE0_INT_CNTL);
@@ -3413,9 +3411,9 @@ static int gfx_v9_0_kiq_irq(struct amdgpu_device *adev,
 			    struct amdgpu_iv_entry *entry)
 {
 	u8 me_id, pipe_id, queue_id;
-	struct amdgpu_ring *ring = (struct amdgpu_ring *)source->data;
+	struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-	BUG_ON(!ring || (ring->funcs->type != AMDGPU_RING_TYPE_KIQ));
+	BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
 
 	me_id = (entry->ring_id & 0x0c) >> 2;
 	pipe_id = (entry->ring_id & 0x03) >> 0;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Xiangliang Yu
#2 lore raw
In reply to a message not in the archive

Thanks!
Xiangliang Yu

Quoted 66 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Trigger Huang
Sent: Tuesday, April 18, 2017 10:14 AM
To: [email protected]
Cc: Huang, Trigger <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix module unload hang by KIQ on Vega10

Apply commit 4e683cb2644f ("drm/amdgpu: Fix module unload hang by KIQ IRQ set")to vega10

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
index f6b2329..b7b2ed8 100644
@@ -631,7 +631,6 @@ static int gfx_v9_0_kiq_init_ring(struct
 amdgpu_device *adev,
 		ring->pipe = 1;
 	}
 
-	irq->data = ring;
 	ring->queue = 0;
 	ring->eop_gpu_addr = kiq->eop_gpu_addr;

sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring-

Quoted 1 line

queue); @@ -647,7 +646,6 @@ static void gfx_v9_0_kiq_free_ring(struct

amdgpu_ring *ring, {

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
 	amdgpu_wb_free(ring->adev, ring->adev->virt.reg_val_offs);
 	amdgpu_ring_fini(ring);
-	irq->data = NULL;
 }
 
 /* create MQD for each compute queue */ @@ -3367,9 +3365,9 @@ static

int gfx_v9_0_kiq_set_interrupt_state(struct amdgpu_device *adev,
enum amdgpu_interrupt_state
state) {

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
 	uint32_t tmp, target;
-	struct amdgpu_ring *ring = (struct amdgpu_ring *)src->data;
+	struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-	BUG_ON(!ring || (ring->funcs->type != AMDGPU_RING_TYPE_KIQ));
+	BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
 
 	if (ring->me == 1)
 		target = SOC15_REG_OFFSET(GC, 0,

mmCP_ME1_PIPE0_INT_CNTL); @@ -3413,9 +3411,9 @@ static int gfx_v9_0_kiq_irq(struct amdgpu_device *adev,

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -3
 			    struct amdgpu_iv_entry *entry)
 {
 	u8 me_id, pipe_id, queue_id;
-	struct amdgpu_ring *ring = (struct amdgpu_ring *)source->data;
+	struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-	BUG_ON(!ring || (ring->funcs->type != AMDGPU_RING_TYPE_KIQ));
+	BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
 
 	me_id = (entry->ring_id & 0x0c) >> 2;
 	pipe_id = (entry->ring_id & 0x03) >> 0;
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Alex Deucher
#3 lore raw
In reply to a message not in the archive
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Trigger Huang
Sent: Monday, April 17, 2017 10:14 PM
To: [email protected]
Cc: Huang, Trigger
Subject: [PATCH] drm/amdgpu: Fix module unload hang by KIQ on Vega10

Quoted 4 lines

Apply commit 4e683cb2644f ("drm/amdgpu: Fix module unload hang by KIQ IRQ set")to vega10

Quoted 61 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
index f6b2329..b7b2ed8 100644
@@ -631,7 +631,6 @@ static int gfx_v9_0_kiq_init_ring(struct
 amdgpu_device *adev,
 		ring->pipe = 1;
 	}
 
-	irq->data = ring;
 	ring->queue = 0;
 	ring->eop_gpu_addr = kiq->eop_gpu_addr;

sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring-

Quoted 1 line

queue);

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
@@ -647,7 +646,6 @@ static void gfx_v9_0_kiq_free_ring(struct
 amdgpu_ring *ring,
 {
 	amdgpu_wb_free(ring->adev, ring->adev->virt.reg_val_offs);
 	amdgpu_ring_fini(ring);
-	irq->data = NULL;
 }
 

/* create MQD for each compute queue */

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -3367,9 +3365,9 @@ static int gfx_v9_0_kiq_set_interrupt_state(struct
 amdgpu_device *adev,
 					    enum amdgpu_interrupt_state
 state)
 {
 	uint32_t tmp, target;
-	struct amdgpu_ring *ring = (struct amdgpu_ring *)src->data;
+	struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-	BUG_ON(!ring || (ring->funcs->type !=
 AMDGPU_RING_TYPE_KIQ));
+	BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -0
 	if (ring->me == 1)
 		target = SOC15_REG_OFFSET(GC, 0,

mmCP_ME1_PIPE0_INT_CNTL);

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -3413,9 +3411,9 @@ static int gfx_v9_0_kiq_irq(struct amdgpu_device
 *adev,
 			    struct amdgpu_iv_entry *entry)
 {
 	u8 me_id, pipe_id, queue_id;
-	struct amdgpu_ring *ring = (struct amdgpu_ring *)source->data;
+	struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-	BUG_ON(!ring || (ring->funcs->type !=
 AMDGPU_RING_TYPE_KIQ));
+	BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
 
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
 	me_id = (entry->ring_id & 0x0c) >> 2;
 	pipe_id = (entry->ring_id & 0x03) >> 0;
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Alex Deucher
#5 lore raw
In reply to a message not in the archive

I think no need to check function type.

Best Regards
Rex
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Deucher, Alexander <[email protected]>
Sent: Tuesday, April 18, 2017 9:33:58 PM
To: Huang, Trigger; [email protected]
Cc: Huang, Trigger
Subject: RE: [PATCH] drm/amdgpu: Fix module unload hang by KIQ on Vega10

Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Trigger Huang
Sent: Monday, April 17, 2017 10:14 PM
To: [email protected]
Cc: Huang, Trigger
Subject: [PATCH] drm/amdgpu: Fix module unload hang by KIQ on Vega10

Quoted 4 lines

Apply commit 4e683cb2644f ("drm/amdgpu: Fix module unload hang by KIQ IRQ set")to vega10

Quoted 58 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
index f6b2329..b7b2ed8 100644
@@ -631,7 +631,6 @@ static int gfx_v9_0_kiq_init_ring(struct
 amdgpu_device *adev,
               ring->pipe = 1;
       }
 
-     irq->data = ring;
       ring->queue = 0;
       ring->eop_gpu_addr = kiq->eop_gpu_addr;
       sprintf(ring->name, "kiq %d.%d.%d", ring->me, ring->pipe, ring-
Quoted 1 line

queue);

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +0 -1
@@ -647,7 +646,6 @@ static void gfx_v9_0_kiq_free_ring(struct
 amdgpu_ring *ring,
 {
       amdgpu_wb_free(ring->adev, ring->adev->virt.reg_val_offs);
       amdgpu_ring_fini(ring);
-     irq->data = NULL;
 }
 

/* create MQD for each compute queue */

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -3367,9 +3365,9 @@ static int gfx_v9_0_kiq_set_interrupt_state(struct
 amdgpu_device *adev,
                                           enum amdgpu_interrupt_state
 state)
 {
       uint32_t tmp, target;
-     struct amdgpu_ring *ring = (struct amdgpu_ring *)src->data;
+     struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-     BUG_ON(!ring || (ring->funcs->type !=
 AMDGPU_RING_TYPE_KIQ));
+     BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
       if (ring->me == 1)
               target = SOC15_REG_OFFSET(GC, 0,

mmCP_ME1_PIPE0_INT_CNTL);

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -2
@@ -3413,9 +3411,9 @@ static int gfx_v9_0_kiq_irq(struct amdgpu_device
 *adev,
                           struct amdgpu_iv_entry *entry)
 {
       u8 me_id, pipe_id, queue_id;
-     struct amdgpu_ring *ring = (struct amdgpu_ring *)source->data;
+     struct amdgpu_ring *ring = &(adev->gfx.kiq.ring);
 
-     BUG_ON(!ring || (ring->funcs->type !=
 AMDGPU_RING_TYPE_KIQ));
+     BUG_ON(ring->funcs->type != AMDGPU_RING_TYPE_KIQ);
 
       me_id = (entry->ring_id & 0x0c) >> 2;
       pipe_id = (entry->ring_id & 0x03) >> 0;
Quoted 7 lines

--
2.7.4

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx