Skip to contentSkip to conversation

drm/amdgpu: avoid using invalidate semaphore for picasso

PATCH In review Changfeng.Zhu 2 participants 2 messages Dec 2, 2019

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

PATCH 2/2 drm/amdgpu: avoid using invalidate semaphore for picasso

From: changzhu <[email protected]>

It may cause timeout waiting for sem acquire in VM flush when using invalidate semaphore for picasso. So it needs to avoid using invalidate semaphore for piasso.

Change-Id I193e6a9eecc0a8b2c99baabf18ad816fb473da52
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 20 ++++++++++++++++----
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  | 20 ++++++++++++++++----
 2 files changed, 32 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +16 -4
index 49b2ce30d629..2f3ba8f143cb 100644
@@ -245,7 +245,10 @@ static void gmc_v10_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((vmhub == AMDGPU_MMHUB_0 ||
 	     vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev))) {
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8))) {
 		for (i = 0; i < adev->usec_timeout; i++) {
 			/* a read return value of 1 means semaphore acuqire */
 			tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem + eng);
@@ -280,7 +283,10 @@ static void gmc_v10_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((vmhub == AMDGPU_MMHUB_0 ||
 	     vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev)))
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8)))
 		/*
 		 * add semaphore release after invalidation,
 		 * write with 0 means semaphore release
@@ -385,7 +391,10 @@ static uint64_t gmc_v10_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
 	     ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev)))
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8)))
 		/* a read return value of 1 means semaphore acuqire */
 		amdgpu_ring_emit_reg_wait(ring,
 					  hub->vm_inv_eng0_sem + eng, 0x1, 0x1);
@@ -403,7 +412,10 @@ static uint64_t gmc_v10_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
 	     ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev)))
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8)))
 		/*
 		 * add semaphore release after invalidation,
 		 * write with 0 means semaphore release
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +16 -4
index 6c9a9c09cdb1..1cfed8787031 100644
@@ -466,7 +466,10 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((vmhub == AMDGPU_MMHUB_0 ||
 	     vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev))) {
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8))) {
 		for (j = 0; j < adev->usec_timeout; j++) {
 			/* a read return value of 1 means semaphore acuqire */
 			tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem + eng);
@@ -498,7 +501,10 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((vmhub == AMDGPU_MMHUB_0 ||
 	     vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev)))
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8)))
 		/*
 		 * add semaphore release after invalidation,
 		 * write with 0 means semaphore release
@@ -531,7 +537,10 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
 	     ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev)))
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8)))
 		/* a read return value of 1 means semaphore acuqire */
 		amdgpu_ring_emit_reg_wait(ring,
 					  hub->vm_inv_eng0_sem + eng, 0x1, 0x1);
@@ -549,7 +558,10 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
 	/* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
 	if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
 	     ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-	    (!amdgpu_sriov_vf(adev)))
+	    (!amdgpu_sriov_vf(adev)) &&
+	    (!(adev->asic_type == CHIP_RAVEN &&
+	       adev->rev_id < 0x8 &&
+	       adev->pdev->device == 0x15d8)))
 		/*
 		 * add semaphore release after invalidation,
 		 * write with 0 means semaphore release
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 6 lines · Changfeng.Zhu

From: changzhu <[email protected]>

It may cause timeout waiting for sem acquire in VM flush when using invalidate semaphore for picasso. So it needs to avoid using invalidate semaphore for piasso.

Is this really just picasso? I think it would be simpler to just disable it for all RAVEN variants.

Alex

Quoted 115 lines
Change-Id I193e6a9eecc0a8b2c99baabf18ad816fb473da52
---
 drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 20 ++++++++++++++++----
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  | 20 ++++++++++++++++----
 2 files changed, 32 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +16 -4
index 49b2ce30d629..2f3ba8f143cb 100644
@@ -245,7 +245,10 @@ static void gmc_v10_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((vmhub == AMDGPU_MMHUB_0 ||
             vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev))) {
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8))) {
                for (i = 0; i < adev->usec_timeout; i++) {
                        /* a read return value of 1 means semaphore acuqire */
                        tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem + eng);
@@ -280,7 +283,10 @@ static void gmc_v10_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((vmhub == AMDGPU_MMHUB_0 ||
             vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev)))
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /*
                 * add semaphore release after invalidation,
                 * write with 0 means semaphore release
@@ -385,7 +391,10 @@ static uint64_t gmc_v10_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
             ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev)))
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /* a read return value of 1 means semaphore acuqire */
                amdgpu_ring_emit_reg_wait(ring,
                                          hub->vm_inv_eng0_sem + eng, 0x1, 0x1);
@@ -403,7 +412,10 @@ static uint64_t gmc_v10_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
             ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev)))
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /*
                 * add semaphore release after invalidation,
                 * write with 0 means semaphore release
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +16 -5
index 6c9a9c09cdb1..1cfed8787031 100644
@@ -466,7 +466,10 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((vmhub == AMDGPU_MMHUB_0 ||
             vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev))) {
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8))) {
                for (j = 0; j < adev->usec_timeout; j++) {
                        /* a read return value of 1 means semaphore acuqire */
                        tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem + eng);
@@ -498,7 +501,10 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((vmhub == AMDGPU_MMHUB_0 ||
             vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev)))
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /*
                 * add semaphore release after invalidation,
                 * write with 0 means semaphore release
@@ -531,7 +537,10 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
             ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev)))
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /* a read return value of 1 means semaphore acuqire */
                amdgpu_ring_emit_reg_wait(ring,
                                          hub->vm_inv_eng0_sem + eng, 0x1, 0x1);
@@ -549,7 +558,10 @@ static uint64_t gmc_v9_0_emit_flush_gpu_tlb(struct amdgpu_ring *ring,
        /* TODO: It needs to continue working on debugging with semaphore for GFXHUB as well. */
        if ((ring->funcs->vmhub == AMDGPU_MMHUB_0 ||
             ring->funcs->vmhub == AMDGPU_MMHUB_1) &&
-           (!amdgpu_sriov_vf(adev)))
+           (!amdgpu_sriov_vf(adev)) &&
+           (!(adev->asic_type == CHIP_RAVEN &&
+              adev->rev_id < 0x8 &&
+              adev->pdev->device == 0x15d8)))
                /*
                 * add semaphore release after invalidation,
                 * write with 0 means semaphore release
--

2.17.1

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